R
rouble
Hi All,
How do I verify if a field within an ADODB.Recordset is NULL ?
I have tried the following two methods that I could think of:
1.
If Not IsNothing(rs("fieldname")) Then
something = Int32.Parse(rs("fieldname").Value())
End If
2.
If Not IsDBNull(rs("fieldname")) Then
something = Int32.Parse(rs("fieldname").Value())
End If
I keep getting the following exception, when I call Value() on any of
the returned objects:
Exception System.InvalidCastException: Cast from type 'DBNull' to type
'String' is not valid.
Any tips are much appreciated.
TIA,
rouble
How do I verify if a field within an ADODB.Recordset is NULL ?
I have tried the following two methods that I could think of:
1.
If Not IsNothing(rs("fieldname")) Then
something = Int32.Parse(rs("fieldname").Value())
End If
2.
If Not IsDBNull(rs("fieldname")) Then
something = Int32.Parse(rs("fieldname").Value())
End If
I keep getting the following exception, when I call Value() on any of
the returned objects:
Exception System.InvalidCastException: Cast from type 'DBNull' to type
'String' is not valid.
Any tips are much appreciated.
TIA,
rouble