Dynamically passing column name in ADO.NET
string[] rowdetails = orderDS.Tables[0].Rows[j]["'"+column[k]+"'"] as string[];
Can a column name can be passed dynamically? The code above is not working when I pass the column name. Double quotes is the proble开发者_JAVA技巧m. I need to pass the column name there.
DataRow has multiple Item properties that you could use:
string[] rowdetails = orderDS.Tables[0].Rows[j][column[k]] as string[];
精彩评论