再dategrid中加模板列
for(int i = 0;i<DataGrid1.Items.Count;i++)
{
CheckBox cb = (CheckBox) DataGrid1.Items[i].Cells[0].Controls[1];
if(cb.Checked)
{
con.Open();
OracleCommand cmd = new OracleCommand("delete from 表名 where XX='"+DataGrid1.Items[i].Cells[x].Text.Trim()+"' and YY='"+DataGrid1.Items[y].Cells[4].Text.Trim()+"'",con);
cmd.ExecuteNonQuery();
con.Close();
}
for(int i = 0;i<DataGrid1.Items.Count;i++)
{
CheckBox cb = (CheckBox) DataGrid1.Items[i].Cells[0].Controls[1];
if(cb.Checked)
{
con.Open();
OracleCommand cmd = new OracleCommand("delete from 表名 where XX='"+DataGrid1.Items[i].Cells[x].Text.Trim()+"' and YY='"+DataGrid1.Items[y].Cells[4].Text.Trim()+"'",con);
cmd.ExecuteNonQuery();
con.Close();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货