怎么获取 DATAGRIDVIEW多行,并删除呢?
string ID =dgvOrder.CurrentRow.Cells["ID"].Value.ToString();
string strSQL = "Delete * from 生产制造通知单主表 where ID=" + ID;
db.Delete(strSQL, CommandType.Text);
MessageBox.Show("删除成功", "订单删除", MessageBoxButtons.OK, MessageBoxIcon.Information);现在我这样只能删除一行。。郁闷int j = dgvOrder.SelectedRows.Count; 我用这个获取的 J=0
不知道怎么回事!
谢谢了
string ID =dgvOrder.CurrentRow.Cells["ID"].Value.ToString();
string strSQL = "Delete * from 生产制造通知单主表 where ID=" + ID;
db.Delete(strSQL, CommandType.Text);
MessageBox.Show("删除成功", "订单删除", MessageBoxButtons.OK, MessageBoxIcon.Information);现在我这样只能删除一行。。郁闷int j = dgvOrder.SelectedRows.Count; 我用这个获取的 J=0
不知道怎么回事!
谢谢了
最后用substring取长度-1,去除最后一个逗号。sql删除语句后面加一个where id not in("你的字符串")应该就可以实现```个人的一点建议```