Hi guys. I'm trying to write a little exe that pulls info from a sql server 2000 database and turns it into a price list. Everything works fine except when I get to something that has a null value. When I try and use a field that has a null value it gives me an error that says "Cannot get value because it is DBNull." This is what the code that throws the error looks like:
Public Property item_desc_2 As String
Return CType(Me(Me.tableIMITMIDX_SQL.item_desc_2Column), String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value
because it is DBNull.", e)
Me(Me.tableIMITMIDX_SQL.item_desc_2Column) = value
I've tried different things out to try and catch the error, but just can't seem to get it. And I'm not used to vb.net, I'm a lot more familiar with php and java. I've tried to find a similar problem online but just can't seem to find one. Any ideas at all would be appreciated.