Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Last active May 27, 2019 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/34e6e220ed3fa9af25548861bbe8eac1 to your computer and use it in GitHub Desktop.
Save gavilanch/34e6e220ed3fa9af25548861bbe8eac1 to your computer and use it in GitHub Desktop.
public async Task Insert(Value value)
{
using (SqlConnection sql = new SqlConnection(_connectionString))
{
using (SqlCommand cmd = new SqlCommand("InsertValue", sql))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@value1", value.Value1));
cmd.Parameters.Add(new SqlParameter("@value2", value.Value2));
await sql.OpenAsync();
await cmd.ExecuteNonQueryAsync();
return;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment