private void BtnEditProfile_Click(object sender, EventArgs e) { EditStudent edit = new EditStudent { studentID = this.UserID }; edit.ShowDialog(); }
private void BtnEditStudent_Click(object sender, EventArgs e) { try { if (selectedStudent != 0) { EditStudent editStudentForm = new EditStudent { studentID = selectedStudent.ToString() }; editStudentForm.ShowDialog(); PopulateGridView(); connection.Close(); } else { MessageBox.Show("Please select a student"); } } catch (Exception error) { MessageBox.Show("Error: " + error.Message); } }