daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Feb 24th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void AddReview(int videoId, Guid userId, string reviewText)
  2.     {
  3.             var connSettings = ConfigurationManager.ConnectionStrings["VideoLibrary"];
  4.             var connString = connSettings.ConnectionString;
  5.  
  6.  
  7.             using (var conn = new SqlConnection(connString))
  8.             {
  9.                 var cmd = conn.CreateCommand();
  10.                 cmd.CommandType = CommandType.Text;
  11.                 cmd.CommandText = @"
  12. INSERT INTO dbo.Reviews (VideoId, UserId, Review)
  13. Values (@VideoID, @UserID, @Review)
  14. ";
  15.                 cmd.Parameters.AddWithValue("VideoID", videoId);
  16.                 cmd.Parameters.AddWithValue("UserID", userId);
  17.                 cmd.Parameters.AddWithValue("Review", reviewText);
  18.                 conn.Open();
  19.  
  20.                 cmd.ExecuteNonQuery();
  21.  
  22.             }
  23.  
  24.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top