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