i should construct dinamically the property name (to set it) in a web service invocation using the variables "section" and "fieldName" derived from the two nested foreach (as shown below). I tried with some code found googling "variable variables" but i didn't succeed. Any help would be appreciated. Thank you.
SyncRequest request = new SyncRequest();
[...]
foreach (String section in sections) {
[DB query]
DataTable dtSectionFields = drSection.GetSchemaTable();
foreach (DataColumn column in dtSectionFields.Columns) {
[...]
fieldName = [something];
fieldContent = [something else];
request.methodx.[section].[fieldName] = fieldContent;
}
}
var vartable = new Dictionary();
vartable[strLine] = new Variable(input);
but maybe i didn't use it in the right way (it's obvious i'm not a c# guru). Would you please provide an example? – user2454589 Jun 05 '13 at 08:49