I love alot of things about .NET but I HATE how they deal with NULLS!!!!!
Please look at my code below and tell me why I can't get my code to recognize that my variable is null!!!
Background; oRow.Item("PageID" is returning a null value.
This
If IsNothing(oRow.Item("PageID") Then
oRow.Item("PageID" = 0
End If
doesn't work.
This
Dim oNull as DBNull
If oRow.Item("PageID".GetType Is oNull Then
oRow.Item("PageID" = 0
End If
doesn't work
The only thing I've been able to get to work is this:
Try
Dim strTest As String
strTest = oRow.Item("PageID"
strTest = Nothing
Catch
oRow.Item("PageID" = 0
End Try
which I'm sure you can tell I'm not happy with.
Any ideas on how to get this darn null thing working?!
Thanks,
Jack
Please look at my code below and tell me why I can't get my code to recognize that my variable is null!!!
Background; oRow.Item("PageID" is returning a null value.
This
If IsNothing(oRow.Item("PageID") Then
oRow.Item("PageID" = 0
End If
doesn't work.
This
Dim oNull as DBNull
If oRow.Item("PageID".GetType Is oNull Then
oRow.Item("PageID" = 0
End If
doesn't work
The only thing I've been able to get to work is this:
Try
Dim strTest As String
strTest = oRow.Item("PageID"
strTest = Nothing
Catch
oRow.Item("PageID" = 0
End Try
which I'm sure you can tell I'm not happy with.
Any ideas on how to get this darn null thing working?!
Thanks,
Jack