I am not vb.net expert, but made to work on it for now. Retrieving value for database, which in some cases Is NULL for a datetime column (Sql database). When it is retrieved in vb.net using something like this.
select testcolumn from testtable
and result converted to datatable. the value fails validation(even though the retrieved value in database is null)
If Not dt("testcolumn") Is Nothing
End If
Ideally this validation is point for me which decides whether the value should be assigned to a property for class. but as this fails.next exception I get is Invalid cast, as i try to do something Like
myClass.datetimeProperty=dt("testcolumn").ToString()
Any reason for this, and is only way to perform additional validation of
If Not string.isnullOrEmpty(dt("testcolumn)