Hi all,
I am trying to create variables dynamically. This is needed because
the user interface can have ten different textboxes with name as txt1,
txt2 and so on. I would like to get values of all and then run in
single transaction.
for (int i = 1; i <= 10; i++)
{
(qry + i)= "insert into table1(field1) values(value1)";
}
This portion of declaring variable (qry + i) is not right and how can
I assign the dynamic variable here.
after creating the query string I want to execute as:
try
{
for (int i = 1; i <= 10; i++)
{
if (qry+ i.ToString != null) //same problem here
{
(qry + i.ToString).ExecuteNonQuery(); //same
problem here
}
}
}
Could you please tell me how I can achive what I am trying to do?
I do highly appreciate your help.
thanks a ton in advance.
best regards,
mamun