Executing a Stored Procedure Programmatically
As an application developer, most of the time you’ll be executing stored procedure programmatically. You can execute a stored procedure programmatically using the command object. Instead of passing a SQL statement, you pass the stored procedure name as the SQL statement to execute a stored procedure. Each data provider provides a command object to execute SQL statements. The command class for the OleDb, Odbc, and Sql data provides are Oledbcommand, Odbccommand, and Sqlcommand, respectively. In listing 10-1, I’ll use sqlcommand to execute a procedure programmatically against a SQL server database.
View the Original article