private void button4_Click(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); for (int i = 0; i < dataGridView1.Rows.Count; i++) { if (dataGridView1.Rows[i].Cells[9].Value != null) { DialogResult dialogResult = MessageBox.Show("Ban Chac Chan Xoa !", "Xoa", MessageBoxButtons.YesNo); switch (dialogResult) { case DialogResult.Yes: dataDAO.Delete(dataGridView1.Rows[i].Cells[0].Value.ToString()); break; case DialogResult.No: break; } } } }