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

You can use such T-SQL statements to get the result from the stored procedure in SQL Server:

declare @.s int
exec @.s=test
select @.s

No comments:

Post a Comment