Skip to content

Instantly share code, notes, and snippets.

Last active May 27, 2019
What would you like to do?
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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment