如题,当dgv中只剩下一条记录时,删除时会抛出异常.有多条记录时,删除是就不会出错, 是什么原因.例如;
BindingSource bsPart = new BindingSource();
bsPart.DataSource = ds.Tables["Part"];
dgvPart.DataSource = bsPart;当dgvPart中只剩下最后一笔记录时,执行删除操作.
bsPart.RemoveCurrent();
SqlCommand cmd = new SqlCommand("Part_Delete",conn);
cmd.CommandType = CommandType.StoreProcedurd;
cmd.Execute();