|
|
改动最小的办法就是
将这里的pl拼接成一个集合 |
|
我也是这么想的,可拼接语言怎么写啊,能写个列子出来看看吗 |
|
40分 |
string pl=""; for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox cbx = (CheckBox)GridView1.Rows[i].FindControl("cbxId"); if (cbx.Checked == true) { pl += """"+GridView1.DataKeys[i].Value.ToString()+""","; } } if(pl!="") { pl = pl.substr(0,pl.length-1); } string sqlText = "update tb_equipment set isactive = 0 where isactive=1 and number in ("+pl+")"; z.ExecSql(sqlText); 你试一下,应该没有什么问题 |