ERROR: Operator '=' is not defined for type 'DBNull' ...
Operator '=' is not defined for type 'DBNull' and string "Option".
I get this above mentioned error while running the application and the following is the code where I get this error.
If dr("Option") = "Option1" Then
...
...
...
End If
I know this happens when there is no record in the DB and has a value 'NULL". But I don't know how to handle this? Please guide me. Thank you!
Re: ERROR: Operator '=' is not defined for type 'DBNull' ...
Code:
If dr("Option") isnot DBNull.Value andalso dr("Option") = "Option1" Then
.....
End If