Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using (SqlConnection conn = new SqlConnection(connectionString))
  2. {
  3. conn.Open();
  4. using (SqlCommand cmd =
  5. new SqlCommand("UPDATE companyDB SET compname=@label3", conn))
  6. {
  7. cmd.Parameters.AddWithValue("@label3", cmpname.Text);
  8. int rows = cmd.ExecuteNonQuery();
  9. }
  10.  
  11.  
  12. }
  13. }
  14. catch (Exception ex)
  15. {
  16. MessageBox.Show("Not Updated");
  17. }
  18.  
  19. new SqlCommand("UPDATE companyDB SET compname=@label3 where id = @id", conn))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement