private void tìmKiếmSinhViênToolStripMenuItem_Click(object sender, EventArgs e) { frmTimSinhVien frm = new frmTimSinhVien(); frm.MdiParent = this; frm.Show(); }
private void button3_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(); con.ConnectionString = KetNoi.str; con.Open(); SqlCommand cmd1 = new SqlCommand(); SqlCommand cmd2 = new SqlCommand(); cmd1.Connection = con; cmd2.Connection = con; cmd1.CommandText = "DELETE FROM KetQua Where ID_SinhVien='" + SinhVien_ID + "'"; cmd2.CommandText = "DELETE FROM SinhVien Where SinhVien_ID='" + SinhVien_ID + "'"; DialogResult result; result = MessageBox.Show("BẠN CÓ MUỐN THAY XÓA THÔNG TIN KHÔNG?", "THÔNG BÁO", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { cmd1.ExecuteNonQuery(); cmd2.ExecuteNonQuery(); MessageBox.Show("XÓA THÀNH CÔNG", "THÔNG BÁO"); } con.Close(); this.Close(); frmTimSinhVien frm = new frmTimSinhVien(); frm.Show(); }