我非常需要你的学校项目帮助
我创建了一个用按钮删除的选定行,当我按下后退按钮时,它不会将删除的行保存在数据库中,我使用的是Microsoft Access“ACCDB”文件格式。
我选择的删除按钮代码:
private void button4_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure you want to delete this employee", "confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
{
{
selectedRow = dataGridView1.CurrentCell.RowIndex;
dataGridView1.Rows.RemoveAt(selectedRow);
}
}
}
我的代码返回按钮:
private void button3_Click_1(object sender, EventArgs e)
{
Form3 A = new Form3();
A.Show();
this.Hide();
}