日期:2014-05-18 浏览次数:21259 次
for (int i = 0; i <= dgvcur.Rows.Count - 1; i++)
{
if (dgvcur.Rows[i].Cells[0].Value == null)
{
continue;
}
bool selected = (bool)dgvcur.Rows[i].Cells[0].Value;
if (selected == false)
{
string sql = "delete from useractions where id='" + dgvcur.Rows[i].Cells[0].Value + "'";
if (DB.executesql(sql))
MessageBox.Show("更新成功", "提示", MessageBoxButtons.OK);
else
MessageBox.Show("更新失败", "提示", MessageBoxButtons.OK);
}
}