I have an action sproc that always returns -1 even though the sproc itself is returning 0.
To try and figure this out I created a really simple sproc and it does the same thing:
ALTER PROCEDURE dbo.TestReturn (@testvalue int)
AS
SET NOCOUNT ON
RETURN 0
Running the above code in SQL Server 2005 returns:
Running [dbo].[TestReturn] ( @testvalue = 1 ).
No rows affected.
(0 row(s) returned)
@RETURN_VALUE = 0
Finished running [dbo].[TestReturn].
Running in LLBLGen as:
ActionProcedures.TestReturn(1);
Returns -1 and "A first chance exception of type 'System.InvalidOperationException' occurred in System.dll"
Why is it not returning 0 or what am I doing wrong?
Many Thanks,
Joe