protected void btnUpdateCustomer_Click(object sender, EventArgs e) { //Creates a boolean to false if the update creates an error bool customerUpdateError = false; //accesses Accounts.mdb database for the clsDataLayer string tempPath = Server.MapPath("Accounts.mdb"); clsDataLayer myDataLayer = new clsDataLayer(tempPath); //Updates Customer Information for all fields try { myDataLayer.UpdateCustomer(txtUserName.Text, txtCity.Text, txtState.Text, txtLeastLanguage.Text, txtFavoriteLanguage.Text); } catch (Exception error) { customerUpdateError = true; string message = "Error updating customer, please check form data. "; Master.UserProgrammer.Text = message + error.Message; } if (!customerUpdateError) { ClearInputs(Page.Controls); Master.UserProgrammer.Text = "Customer Updated Successfully"; } //Binds CustomerGridView() BindCustomerGridView(); }