What's the difference between or and OrElse?
if temp is dbnull.value or temp = 0
produces the error:
Operator '=' is not defined for type 'DBNull' and type 'Integer'.
while this one works like a charm!?
if temp is dbnull.value OrElse temp = 0
See Question&Answers more detail:os