Click here to Skip to main content
16,015,481 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello to All !

I m working in VB.NET 2010 with SQL Server 2008.

I created a Stored Procedure with output parameter in my Database using SQL Server 2008 Management Studio
Like this ...

Create PROCEDURE sp_InventoryAnalysis_M(

@RecordNoItem INT,
@ItemName NVarChar(200) Out,
@NetStock Money Out
)
As
Begin

Select
@ItemName=tbl_Items.ItemName
From
tbl_Items
Where
tbl_Items.RecordNoItem=@RecordNoItem
Order By
tbl_Items.RecordNoItem

Select
@NetStock=SUM(tbl_Stock.ItemIn)-SUM(tbl_Stock.ItemOut)
From
tbl_Stock
Where
tbl_Stock.RecordNoCompany=@RecordNoItem
End

now i am trying to execute this procedure in sql server management studio like this ...

Execute sp_InventoryAnalysis_M 15

but it gives me the following error ...

ASM
Msg 201, Level 16, State 4, Procedure sp_InventoryAnalysis_M, Line 0
Procedure or function 'sp_InventoryAnalysis_M' expects parameter '@ItemName', which was not supplied.


can anyone identify where i made mistake ?

The second question is this i want to execute this procedure in my VB.NET application and get value from its output parameter and use assign it into a variable.

Thanks.
Posted

 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900