Created
November 15, 2016 11:01
-
-
Save smetronic/45880e4949c92dc55ec317c4305a516a to your computer and use it in GitHub Desktop.
ExecuteNonQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString)) | |
{ | |
connection.Open(); | |
using (SqlCommand cmd = new SqlCommand(@"SELECT * FROM Table WHERE Id = @Input", connection)) | |
{ | |
cmd.Parameters.Add("Input", SqlDbType.Int).Value = 1; | |
cmd.ExecuteNonQuery(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment