Wednesday, February 24, 2010

DBNull is a type and cannot be used as an expression

This is a compile time error which occurs when checking whether the value is System.DBNULL with the following statement..

If result Is System.DBNULL Then

End If

The correct statement should be

If result Is System.DBNULL.Value Then

End If

No comments:

Post a Comment