//实现批量删除
protected void btnpliang_Click(object sender, EventArgs e)
{
//循环判断checkbox的选中情况
for (int i = 0; i < griew.Rows.Count; i++)
{
CheckBox ck = (CheckBox)(griew.Rows[i].FindControl("CheckBox1"));
//若选中,执行删除操作
if (ck.Checked)
{
int id = Convert.ToInt32(griew.DataKeys[i].Value);
string sql = "delete from BBS_Reply where ReplyID=" + id;
clsMySql.ExecuteNonQuery(sql);
}
}
Bind();
}