Wednesday, March 28, 2012

How to get the return value when using a TableAdapter access a Stored Procedure

I have a Stored Procedure

CREATE PROCEDURE test
AS
BEGIN
SELECT Count(*) FROM dbo.test
END

I can using the unbox get the return value

but if i direct return a value form a Stored Procedure like this

CREATE PROCEDURE test
AS
BEGIN
return 100
END

I can not get the VALUE
I do not know how to
Please Help Me
thx

Hi,

and welcome to the ASP.NET forums.

You can use aSqlParameter with Direction set toParameterDirection.ReturnValue. Pleasetake a look at this little code sample.

Grz, Kris.

No comments:

Post a Comment