Resolved Dataset and Sql Stored Proc return value

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
I'm working on an app that will use a few stored procedures in the Sql Server 2008 database. I've created the stored procedures and they all return either a 1 if they succeed or a -1 if they fail & Management studio displays the values returned just fine when I run them. On the vb.net side, I've added the Dataset to the project and the several tables I've added work fine, but when it comes to the stored procedures (yes, I've selected the one that says there's a return value) when I call it in code it's working but I'm not getting the return value. Any ideas?
 
It could be returned as a ReturnValue command parameter, which is different from a Output command parameter.
 
It could be returned as a ReturnValue command parameter, which is different from a Output command parameter.

How would I go about doing that?

When I put in the procedure call the xsd designer generates all the code. All I do is declare the TableAdapter and call the method that it's provided & pass in any parameters that it needs.
 
Actually I ended up changing the line in my Stored Proc from 'Return @ReturnVal' to 'Select @ReturnVal' now vb sees the return value.
 
Back
Top