Return Values and SqlHelper

R

riversmithco

Does anyone have an example of getting a return value back from a
stored proc using the SqlHelper data block? This should be so easy!

Here is my stored proc:


CREATE PROCEDURE AddEmployee
(
@SessionID varchar(24),
@EmployeeID varchar(6)
)
AS


IF (SELECT COUNT(*) FROM Employees WHERE EmployeeID = @EmployeeID) = 0

BEGIN

INSERT INTO Employees
(
SessionID,
EmployeeID

)
VALUES
(
@SessionID,
@EmployeeID
)

RETURN 1

END

ELSE

RETURN 0
GO


Thanks
 
N

NuTcAsE

Havnt used SqlHelper block but im assuming its a wrappeter over the
existing ado.net architecture. If there is a function to add Parameters
to a command, then you can create a command of type int and set its
direction to ReturnValue. That should get the return value back from
the database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top