1.

Give An Example That Shows How To Execute A Stored Procedure In Ado.net?

Answer»

Answer : using (SQLCONNECTION ConnectionObject = new SqlConnection()) { //Specify the name of the stored PROCEDURE to execute and the CONNECTION Object to use.
SqlCommand CommandObject = 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
int RecordsAffected = CommandObject.ExecuteNonQuery();
}



Discussion

No Comment Found