Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. using (SqlConnection con = new SqlConnection(cs))
  2. {
  3. string Query = "update DeviceDetails set GroupId = NULL, InUse = 0 , Status = 'Deleted' Where Id = @Id";
  4. using (SqlCommand cmd = new SqlCommand(Query, con))
  5. {
  6.  
  7. try
  8. {
  9. con.Open();
  10. cmd.CommandType = CommandType.Text;
  11. cmd.Parameters.AddWithValue("@Id", SqlDbType.NVarChar);
  12.  
  13. cmd.ExecuteNonQuery();
  14. }
  15. catch (Exception ex)
  16. {
  17. Response.Write(ex.Message);
  18. }
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement