private void tsbDel_Click(object sender, EventArgs e) { if (dataGridView1.CurrentCell != null) { if (MessageBox.Show("是否删除记录?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { try { RoleBll.DelRole(dataGridView1.CurrentRow.Cells[0].Value.ToString()); dataGridView1.DataSource = RoleBll.RoleFillDs().Tables[0]; getcolumn(); MessageBox.Show("删除成功!"); } catch (Exception ee) { MessageBox.Show("删除失败!" + ee); throw; } } } }