M
Miro
Hi,
I have been struggling with this for a long time now and I cant seem to find
a solution.
I have a typed dataset with an int32 column ( that I just added to an access
database ).
So now within the database I have dbnull's in all the old records that did
not have this int32.
So if I read my field I get an exception error.
I put this simple code infront of the code as I have been googling around:
Dim IDNullError As Boolean = False
If ShoppingCartBibCustomRow.IsFrontColorIDNull Then
IDNullError = True
Else
IDNullError = False
End If
but it always returns FALSE - never true.
In the "Immediate Window" for debugging:
? ShoppingCartBibCustomRow.IsFrontColorIDNull
False
but if I look at the value in the Locals tab...
+ FrontNameColorID {"The value for column 'FrontNameColorID' in table
'ShoppingCartBibCustom' is DBNull."} Integer
so If I actaully do this in the "Immediate window",
? ShoppingCartBibCustomRow.FrontNameColorID
ill get the exception:
A first chance exception of type 'System.InvalidCastException' occurred in
Microsoft.VisualBasic.dll
A first chance exception of type 'System.Data.StrongTypingException'
occurred in App_Code.rd6a6lcl.dll
So why does it not return that it is a null value in the first place.
Thank you,
Miro
I have been struggling with this for a long time now and I cant seem to find
a solution.
I have a typed dataset with an int32 column ( that I just added to an access
database ).
So now within the database I have dbnull's in all the old records that did
not have this int32.
So if I read my field I get an exception error.
I put this simple code infront of the code as I have been googling around:
Dim IDNullError As Boolean = False
If ShoppingCartBibCustomRow.IsFrontColorIDNull Then
IDNullError = True
Else
IDNullError = False
End If
but it always returns FALSE - never true.
In the "Immediate Window" for debugging:
? ShoppingCartBibCustomRow.IsFrontColorIDNull
False
but if I look at the value in the Locals tab...
+ FrontNameColorID {"The value for column 'FrontNameColorID' in table
'ShoppingCartBibCustom' is DBNull."} Integer
so If I actaully do this in the "Immediate window",
? ShoppingCartBibCustomRow.FrontNameColorID
ill get the exception:
A first chance exception of type 'System.InvalidCastException' occurred in
Microsoft.VisualBasic.dll
A first chance exception of type 'System.Data.StrongTypingException'
occurred in App_Code.rd6a6lcl.dll
So why does it not return that it is a null value in the first place.
Thank you,
Miro