Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created May 27, 2019 02:47
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/3046489d94ee5ce6b301c99b69448214 to your computer and use it in GitHub Desktop.
Save gavilanch/3046489d94ee5ce6b301c99b69448214 to your computer and use it in GitHub Desktop.
public async Task DeleteById(int Id)
{
using (SqlConnection sql = new SqlConnection(_connectionString))
{
using (SqlCommand cmd = new SqlCommand("DeleteValue", sql))
{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Id", Id));
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