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 CheckMFileToBeC losed() As Boolean
Dim result As Object
myCommand.Param eters.Clear()
myCommand.Comma ndText = "SELECT Result = CASE WHEN DischargeDate IS NULL
THEN 1 " & _
"ELSE 0 END " & _
"FROM dbo.MedicalFoll owUpInHospital " & _
"WHERE OurFileNo = @medicalFileNo"
myCommand.Comma ndType = CommandType.Tex t
myCommand.Param eters.Add("@med icalFileNo", Session("select edFileNumber")
+ "M")
result = myCommand.Execu teScalar()
If CInt(result) = 1 Then
Return False
Else
Return True
End If
End Function
Thanks in advance,
Buran
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 CheckMFileToBeC losed() As Boolean
Dim result As Object
myCommand.Param eters.Clear()
myCommand.Comma ndText = "SELECT Result = CASE WHEN DischargeDate IS NULL
THEN 1 " & _
"ELSE 0 END " & _
"FROM dbo.MedicalFoll owUpInHospital " & _
"WHERE OurFileNo = @medicalFileNo"
myCommand.Comma ndType = CommandType.Tex t
myCommand.Param eters.Add("@med icalFileNo", Session("select edFileNumber")
+ "M")
result = myCommand.Execu teScalar()
If CInt(result) = 1 Then
Return False
Else
Return True
End If
End Function
Thanks in advance,
Buran
Comment