SqlConnection conn = new SqlConnection();
conn.ConnectionString = ClassConnAll.conmmsy;
try
{
if (MessageBox.Show("选中行号深蓝色才能删除,确认删除该行吗?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
conn.Open();
int i = this.dataGridViewItemCls.SelectedRows.Count - 1;
Debug.WriteLine("AA={0}", i); //调试语句
for (int a = i; a >= 0; a--)
{
Debug.WriteLine("a={0}", a);//调试语句
string sqlstring = "delete from t_bd_item_clsmmsy where ID='" + dataGridViewItemCls.SelectedRows[a].Cells[0].Value.ToString() + "'";
conn.ConnectionString = ClassConnAll.conmmsy;
try
{
if (MessageBox.Show("选中行号深蓝色才能删除,确认删除该行吗?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
conn.Open();
int i = this.dataGridViewItemCls.SelectedRows.Count - 1;
Debug.WriteLine("AA={0}", i); //调试语句
for (int a = i; a >= 0; a--)
{
Debug.WriteLine("a={0}", a);//调试语句
string sqlstring = "delete from t_bd_item_clsmmsy where ID='" + dataGridViewItemCls.SelectedRows[a].Cells[0].Value.ToString() + "'";