Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using (SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=PLACE DATABASE DIRECTORY HERE;Integrated Security=True;User Instance=True"))
  2. using (SqlCommand cmd = new SqlCommand("PLACE UPDATE STATEMENT HERE", con))
  3. {
  4. try
  5. {
  6. con.Open();
  7. cmd.ExecuteNonQuery();
  8. Response.Redirect(Request.RawUrl);
  9. }
  10.  
  11. catch (SqlException ex)
  12. {
  13. }
  14.  
  15. finally
  16. {
  17. con.Close();
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement