T
TheNortonZ
I must be just looking at this for so long I am going blind. Here is part of the code:
For Each _lRow In _laRow
Me.DepYrStraightLine.DepreciationYearID = CType((_lRow.Item("DepreciationYearID")), System.Guid)
Me.DepYrStraightLine.DepreciationID = CType((_lRow.Item("DepreciationID")), System.Guid)
Me.DepYrStraightLine.DepreciationTypeID = CType((_lRow.Item("DepreciationTypeID")), Integer)
Me.DepYrStraightLine.Year1 = CType((_lRow.Item("Year1")), Decimal)
Me.DepYrStraightLine.Year1BookValue = CType((_lRow.Item("Year1BookValue")), Decimal)
Me.DepYrStraightLine.Year2 = CType((_lRow.Item("Year2")), Decimal)
Me.DepYrStraightLine.Year2BookValue = CType((_lRow.Item("Year2BookValue")), Decimal)
The rows (or columns rather) Year1BookValue and Year2BookValue are two new columns I added to the table. I have gone all the way from the stored procs and tables and through the code to make sure everything was identical on the column data type settings. The data type is just like 'Year1' and 'Year2'. Decimal, default value of (0.0) 27 precision and 15 scale.
When I step through with the debugger and get to any of the new columns, I get an invalid cast exception that says the cast to DBNull from Decimal is not allowed. However, the 'Year1'/'Year2 fields have 0D in them.
Any idea what could be causing this problem?
Thanks.
Norton
For Each _lRow In _laRow
Me.DepYrStraightLine.DepreciationYearID = CType((_lRow.Item("DepreciationYearID")), System.Guid)
Me.DepYrStraightLine.DepreciationID = CType((_lRow.Item("DepreciationID")), System.Guid)
Me.DepYrStraightLine.DepreciationTypeID = CType((_lRow.Item("DepreciationTypeID")), Integer)
Me.DepYrStraightLine.Year1 = CType((_lRow.Item("Year1")), Decimal)
Me.DepYrStraightLine.Year1BookValue = CType((_lRow.Item("Year1BookValue")), Decimal)
Me.DepYrStraightLine.Year2 = CType((_lRow.Item("Year2")), Decimal)
Me.DepYrStraightLine.Year2BookValue = CType((_lRow.Item("Year2BookValue")), Decimal)
The rows (or columns rather) Year1BookValue and Year2BookValue are two new columns I added to the table. I have gone all the way from the stored procs and tables and through the code to make sure everything was identical on the column data type settings. The data type is just like 'Year1' and 'Year2'. Decimal, default value of (0.0) 27 precision and 15 scale.
When I step through with the debugger and get to any of the new columns, I get an invalid cast exception that says the cast to DBNull from Decimal is not allowed. However, the 'Year1'/'Year2 fields have 0D in them.
Any idea what could be causing this problem?
Thanks.
Norton