private void ButtonDelete_Click(object sender, EventArgs e) { try { DialogResult dialogResult = MessageBox.Show("Обраний запис видалится.", "Видалити?", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { BusinessClass.DataDeleteStudent(Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value.ToString())); } UpdateData(TableName); PresentationLayerClass.ClearBeforeCreate(panel1, pictureBox1, dataGridView1); FlagSelectedRow = true; } catch { } }