I have a query like so:
Dim clcexists = (From p In dbContext.Signatures _
Where p.StudentID = people_id _
And p.ContractType = "clc" _
Order By p.ID Descending _
Select p)
Later I check whether any rows exist in clcexists using IsNothing like so:
If IsNothing(clcexists) Then ' If no CLC is on file.
clcfirst = Date.Now.Subtract(year)
clcdate = clcfirst
Else ' If CLC is on file.
clcfirst = clcexists.FirstOrDefault()
clcdate = clcfirst.SignatureDate
End If
But IsNothing() is not functioning like I expect. There is no row in the results table, but it is still acting as if there is and going to the Else clause. Help?
You might want to use
Anyinstead: