using (SqlConnectionConnectionObject = new SqlConnection())
{
//Specify the name of the stored procedure to execute and the Connection Object to use
SqlCommandCommandObject = new SqlCommand("StoredProcedureName", ConnectionObject);
//Specify the SQL Command type is a stored procedure
CommandObject.CommandType = CommandType.StoredProcedure;
//Open the connection
ConnectionObject.Open();
//Execute the Stored Procedure
intRecordsAffected = CommandObject.ExecuteNonQuery();
}
{
//Specify the name of the stored procedure to execute and the Connection Object to use
SqlCommandCommandObject = new SqlCommand("StoredProcedureName", ConnectionObject);
//Specify the SQL Command type is a stored procedure
CommandObject.CommandType = CommandType.StoredProcedure;
//Open the connection
ConnectionObject.Open();
//Execute the Stored Procedure
intRecordsAffected = CommandObject.ExecuteNonQuery();
}
No comments:
Post a Comment