Dear .NET Programmers,
I use the following code snippet but can't figure out what is going wrong
since the result object equals to nothing although it shouldn't be :)
Function CheckMFileToBeClosed() As Boolean
Dim result As Object
myCommand.Parameters.Clear()
myCommand.CommandText = "SELECT Result = CASE WHEN DischargeDate IS NULL
THEN 1 " & _
"ELSE 0 END " & _
"FROM dbo.MedicalFollowUpInHospital " & _
"WHERE OurFileNo = @medicalFileNo"
myCommand.CommandType = CommandType.Text
myCommand.Parameters.Add("@medicalFileNo", Session("selectedFileNumber")
+ "M")
result = myCommand.ExecuteScalar()
If CInt(result) = 1 Then
Return False
Else
Return True
End If
End Function
Thanks in advance,
Buran