Either execute the stored procedure:
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand com = new SqlCommand("myProcedureName", con))
{
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@Param1", "My Parameter 1 value");
com.Parameters.AddWithValue("@Param2", "My Parameter 1 value");
com.Parameters.AddWithValue("@Param3", "My Parameter 1 value");
com.ExecuteNonQuery();
}
}
or just execute it as code:
using (SqlConnection con = new SqlConnection(strConnect))
{
con.Open();
using (SqlCommand com = new SqlCommand("DELETE FROM table WHERE id=@ID", con))
{
com.Parameters.AddWithValue("@ID", idToDelete);
com.ExecuteNonQuery();
}
}