Exemple #1
0
 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();
 }
Exemple #2
0
 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); }
 }
Exemple #3
0
 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);
     }
 }
Exemple #4
0
 private void saveChanges_Click(object sender, EventArgs e)
 {
     schoolContext.SaveChanges();
     MessageBox.Show("Change(s) saved to the database.");
     Refresh();
 }