|
-
Dec 3rd, 2003, 05:24 PM
#1
Thread Starter
New Member
call store procedures
I make this store procedure:
CREATE PROCEDURE sp_SubstractInventory
(
@product int,
@qty int
AS
Update tblInventario set stock = (stock-@qty) where num = @product
/* SET NOCOUNT ON */
RETURN
GO
I try to run this code with this code in VB .Net:
Dim dr As OdbcDataReader
Dim cmd As OdbcCommand = New OdbcCommand("sp_SubstractInventory", cn)
cmd.CommandType = CommandType.StoredProcedure
Dim param1 As OdbcParameter = New OdbcParameter("@product", 3)
Dim param2 As OdbcParameter = New OdbcParameter("@qty", 3)
param1.Direction = ParameterDirection.Input
param2.Direction = ParameterDirection.Input
cn.Open()
dr = cmd.ExecuteReader()
cn.Close()
The debuger sends me this error:
ERROR [4200] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'sp_SubstractInventory' expects parameter '@product' wich was not supplied.
Please let me know what is the problem I got
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|