110,567
社区成员
发帖
与我相关
我的任务
分享
string strID="(";
int i = 0;
foreach (DataGridViewRow dgvRow in dgvMain.Rows)
{
if (Convert.ToBoolean(dgvRow.Cells[0].Value) == true)
{
strID +=(dgvRow.Cells[1].Value.ToString()+",");
i++;
}
}
strID += "-1)";
if (i == 0) return;
if (MessageBox.Show("是否确定删除?", "提示信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
{
return;
}
if (db.exec("delete from smsReceiveList where smsReceiveID in " + strID) > 0)
{
MessageBox.Show("删除成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
}