private void saveChanges_Click(object sender, EventArgs e) { //Save Object changes to the database, display a message, and refresh the form. schoolContext.SaveChanges(); MessageBox.Show("Changes saved to the database."); this.Refresh(); }
private void saveChanges_Click(object sender, EventArgs e) { try { schoolContext.SaveChanges(); MessageBox.Show("Changes saved to the database."); this.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void saveChanges_Click(object sender, EventArgs e) { try { // Save object changes to the database, // display a message, and refresh the form. schoolContext.SaveChanges(); MessageBox.Show("Changes saved to the database."); this.Refresh(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void saveChanges_Click(object sender, EventArgs e) { schoolContext.SaveChanges(); MessageBox.Show("Change(s) saved to the database."); Refresh(); }