Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- connection.Open();
- try
- {
- OleDbCommand command = new OleDbCommand();
- command.Connection = connection;
- string query = "update Customer set Title='" + titleComboBox2.Text + "',[Name]='" + nameTextBox2.Text + "',Member='" + memberComboBox2.Text + "',Email='" + emailTextBox2.Text + "',[Phone No]='" + phoneNoTextBox2.Text + "',Facility='" + facilityComboBox2.Text + "',[Unit Size]='" + unitSizeComboBox.Text + "',[Start Date]='" + start_DTP2.Value.ToString("yyyy-MM-dd") + "',[Rent Duration]='" + rentDurationTextBox2.Text + "',[End Date]='" + end_DTP2.Value.ToString("yyyy-MM-dd") + "',[Storage Item]='" + storageItemComboBox2.Text + "',[Air Condition]='" + airConComboBox2.Text + "',[Total Monthly Cost]='" + totalMonthlyCostTextBox2.Text + "',[Total Rental Cost]='" + totalRentalCostTextBox2 + "' where ID=" + idTextBox + "";
- command.CommandText = query;
- command.ExecuteNonQuery();
- MessageBox.Show("Data edited");
- }
- catch (Exception exception)
- {
- MessageBox.Show(exception.ToString());
- }
- connection.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement