Stored Procedures in VB.NET
The data provider is a set of components that include the Connection, Command, DataReader, and DataAdapter Objects. The command Object provides a number of Execute methods that can be used to perform the SQL queries in a variety of fashions.
A stored procedure is a precompiled executable object that contains one or more SQL statements. A sample Stored Procedure is given below :
The above code create a procedure named as 'SPPUBLISHER' and it execute SQL statement that select all publisher name from publishers table from the PUB database.
Using stored procedures, database operations can be encapsulated in a single command, optimized for best performance, and enhanced with additional security. To call a stored procedure from VB.NET application, set the CommandType of the Command object to StoredProcedure.
From the following source code you can see how to call a stored procedure from VB.NET application.