Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetExecScalar Returns Nothing
Message
From
20/10/2004 16:39:04
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
GetExecScalar Returns Nothing
Miscellaneous
Thread ID:
00953138
Message ID:
00953138
Views:
50
I have the following function within my business object that was designed to return "True" or "False" but I can only get the function to return "Nothing". When I execute the SQL Stored Procedure, I am always getting the expected "True" or "False" results. What am I missing in getting VB.NET and MM.NET to return the value of the stored procedure.

Public Function GetBatchAlreadyProcessed(ByVal batchID As Integer) As String
Dim dao As mmDataAccessBase = Me.GetDataAccessObject
Dim BatchIdParam As IDbDataParameter = dao.CreateParameter("@BatchId", batchID)
BatchIdParam.Direction = ParameterDirection.Input
Return CStr(Me.ExecSprocScalar("tsgsp_GetBatchAlreadyProcessedTF", BatchIdParam))
End Function

CREATE FUNCTION tsgsp_GetBatchAlreadyProcessedTF
(@BatchId int)
RETURNS CHAR(5)
AS
BEGIN
DECLARE @BatchProcessedTF AS CHAR(5)

SELECT @BatchProcessedTF =
CASE
WHEN COUNT(DISTINCT BatchId) = 1 THEN 'True'
ELSE 'False'
END
FROM
ParticipantCheckDetail
WHERE
BatchID = @BatchId
RETURN @BatchProcessedTF
END
GO

-- =============================================
-- Example to execute function
-- =============================================
SELECT dbo.tsgsp_GetBatchAlreadyProcessedTF
(20)
GO
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Next
Reply
Map
View

Click here to load this message in the networking platform