I didn't test the following, but I think the idea is clear:
using(var conn = new SqlConnection(connStr)) {
using(var cmd = new SqlCommand(storedProcedureName, conn) {
cmd.CommandType = CommandType.StoredProcedure;
return cmd.ExecuteNonQuery();
}
}
there are some examples
here[
^]
and
here[
^]