I have a function that pulls articles records from an MSSQL database. Some are URLs to PDFs, and other are actual articles stored in the SQL. The articles that are stored do not have a URL (DBNull) in the record, so I want to be able to parse that. I tried a simple test:
If Row.Item("url").GetType Is GetType(DBNull) Then
//' do something here....
End If
However, I get the "Conversion from type 'DBNull' to type 'String' is not valid.
" exception. The funny part is, when I do a watch on the above conditional, it returns True
or False
.
Anyone know why this is happening and/or a way to fix this? Thanks!