I have two database tables, in one of them I have some messages (like a template) and in the second one I have the values that should be replaced in the message.
I'll try to explain myself
In table A I have something like this
Id - Message
1 - "User {0} has logon from {1}"
In table B I have something like this
Id - Id Message - ParamValue - ParamPosition
1 - 1 - Hugo - 0
2 - 1 - Computer A - 1
What I would like to have is a message formed like
User Hugo has logon from Computer A
Something like string.format in c#.
How can I do this and how can I do it no matter how many parameters does the message have?
Thanks for your help!