May 2002
Beginner
408 pages
9h 10m
English
The Command object contains a collection of stored procedure parameters named, aptly enough, Parameters. If your stored procedure requires input parameters or returns values using one or more output parameters, you will need to add each parameter to the Parameters collection.
For example, consider the Customer_GetByID stored procedure you created at the beginning of this hour. To set up the parameter object, the first step is to declare the parameter, as follows:
Dim parameterCustomerID As SqlParameter = New SqlParameter("@CustomerID", _
SqlDbType.NChar, 4)
Note that the name of the parameter must match the name of the parameter declared inside the stored procedure. Additionally, the type must match, as well. After the parameter ...
Read now
Unlock full access