开发者

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[];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜