Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. connection.Open();
  2.  
  3. try
  4. {
  5.  
  6. OleDbCommand command = new OleDbCommand();
  7. command.Connection = connection;
  8. 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 + "";
  9. command.CommandText = query;
  10.  
  11. command.ExecuteNonQuery();
  12. MessageBox.Show("Data edited");
  13.  
  14.  
  15. }
  16. catch (Exception exception)
  17. {
  18. MessageBox.Show(exception.ToString());
  19. }
  20. connection.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement