![]() |
#2
hmhz2007-09-09 15:03
|
for (int j = 0; j < CheckBoxList1.Items.Count; j++)
{
if (CheckBoxList1.Items[j].Selected)
{
string update = "update 图书信息 set 状态='" + x + "' where 图书名称='" + CheckBoxList1.Items[j].Text + "'";
SqlCommand command = new SqlCommand(update, connection);
command.ExecuteNonQuery();
}
}
明明我只选了一个,但是两个数据的信息都分别更新了,就是说另外一个也被当作选中项读取了。求大侠们帮帮忙啊!!!!!或者告诉我别的读取CheckBoxList的语句也行啊!!谢谢啦!!!!!!!!!!!!!!!!