private void customersBindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (this.Validate()) //form.CausesValidation = True ? { try { this.customersBindingSource.EndEdit(); this.customersTableAdapter.Update(this._customers_03DataSet.Customers); MessageBox.Show("Your data has been updated.", "Transaction Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (DBConcurrencyException ex) //concurrency error { MessageBox.Show("Someone else changed this account so I cannot save your changes." + ex.Message, "Mulitple Users Error", MessageBoxButtons.OK, MessageBoxIcon.Error); LoadDB(); } catch (DataException ex) // ADO error edit/update/delete { MessageBox.Show(ex.Message, ex.GetType().ToString()); LoadDB(); } catch (OleDbException ex) //OleDB Error { MessageBox.Show("I cannot access the database." + ex.Message, ex.GetType().ToString()); LoadDB(); } } } /* ==================DATA VALIDATION SECTION======================== I Created one Validating event by using the properties window of each textbox. Click on the lightning bolt to bring up a list of the possible events to use. Choose validating and it creates the template for you. I renamed this event TextBox_Validating. * * The CustID, last, and firstname textboxes are wired to this event handler. */ private void TextBox_Validating(object sender, CancelEventArgs e) { TextBox whichTextBox = (TextBox) sender; //convert sender object to a textbox switch (whichTextBox.Name) { case "custIDTextBox": myValidator.ControlText = "CustomerID"; break; case "lastNameTextBox": myValidator.ControlText = "Last Name"; break; case "firstNameTextBox": myValidator.ControlText = "First Name"; break; } if (myValidator.IsLegal(whichTextBox) == false) { if (MessageBox.Show("Do you want to continue or not?", MYMSG, MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.No) { e.Cancel = true; LoadDB(); } else { whichTextBox.Focus(); } } }