private void picupdate_Click(object sender, EventArgs e) { if (this.gridView1.FocusedRowHandle >= 0) { aers_tbl_hospdep data = this.gridView1.GetRow(this.gridView1.FocusedRowHandle) as aers_tbl_hospdep; if ((MessageBox.Show("确定要删除吗?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)) { int i = dal.Delete(data.HospdepId); if (i > 0) { DataBind(); } else { MessageBox.Show("删除失败!"); } } } }