开发者

Dynamically passing column name in ADO.NET

开发者 https://www.devze.com 2023-01-06 03:21 出处:网络
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 quo
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

精彩评论

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