private void update_button_Click(object sender, EventArgs e) { CustomerDB custDB = new CustomerDB(); if (!string.IsNullOrWhiteSpace(custId_textBox.Text)) { int custId = Convert.ToInt32(custId_textBox.Text); if (Convert.ToInt32(custId_textBox.Text) <= 0) { if (dataLoaded) { if (custDB.selectCustomer(custId)) { string firstName = first_name_textBox.Text; string lastName = last_name_textBox.Text; string address = address_textBox.Text; string city = city_textBox.Text; string state = state_comboBox.SelectedItem.ToString(); int postalCode = Convert.ToInt32(postal_code_textBox.Text); string country = country_comboBox.SelectedItem.ToString(); DateTime dob = dobPicker.Value; string ssn = ssn_textBox.Text; string phone = cell_phone_textBox.Text; string email = email_textBox.Text; string username = uname_textBox.Text; string password = password_textBox.Text; if (custDB.updateData(Convert.ToInt32(custId_textBox.Text), firstName, lastName, address, city, state, postalCode, country, dob, ssn, phone, email, username, password)) { MessageBox.Show("Data updated successfully"); } } else { MessageBox.Show("Invalid Customer ID"); editCustomer_clearUp(); } } } } else { MessageBox.Show("Please enter Customer ID"); editCustomer_clearUp(); } }