private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.CurrentCell.Value.ToString().Equals("Delete")) { DialogResult res = MessageBox.Show("Are you sure you want to delete the item?", "Shayona", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (res == DialogResult.Yes) { conn.Open(); int id = Int32.Parse(dataGridView1.CurrentRow.Cells[6].Value.ToString()); str = "delete from branchdetails where BranchID=" + id; cmd = new MySqlCommand(str, conn); cmd.ExecuteNonQuery(); conn.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)