In my stored procedure I'm using code like the following:
Create Procedure foo
@ID int OUTPUT,
@Subject varchar(255)
AS
SET NOCOUNT ON
Insert into Tablename (subject) values @subject) <br>
set @ID = Scope_Identity()
SET NOCOUNT ON
In my code I'm calling the stored procedure like so:
Dim param as new sqlparameter("@ID", sqldbtype.int, 4, ParameterDirection.Output)<br>
cmd.parameters.add(param)<br>
cmd.parameters.add("@Subject", sqldbtype.varchar, 200).Value = "Test"
When I try to call the stored procedure I get an error that the stored procedure is looking for an @ID parameter which was not provided. Can anyone give me an idea why?