Decimal's scale Value Error When Filling DataSet
-
- Posts: 25
- Joined: Mon 02 Oct 2006 19:15
Decimal's scale Value Error When Filling DataSet
Hello,
I know this has been raised before but what is the best way to deal with fetching columnar data with greater then 29 decimals into a dataset?
Please keep in mind I need to have this dataset "wired" for update to a grid.
Below is a link where I found it was addressed, but I'm still getting the issue in the latest build 4.50.30
http://crlab.com/forums/viewtopic.php?t ... ht=decimal
I know this has been raised before but what is the best way to deal with fetching columnar data with greater then 29 decimals into a dataset?
Please keep in mind I need to have this dataset "wired" for update to a grid.
Below is a link where I found it was addressed, but I'm still getting the issue in the latest build 4.50.30
http://crlab.com/forums/viewtopic.php?t ... ht=decimal
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 25
- Joined: Mon 02 Oct 2006 19:15
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 25
- Joined: Mon 02 Oct 2006 19:15
Hello,
Found an interesting issue with the OracelDataTable and large numbers.
If you attempt to the OracleDataTable in the standard way included in the Corelab sample within the documentation and select from the below table you'll get the following message:
Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale
I'm using the 4.50.30 build against Oracle 10gR2. Is there a work around for this type of issue, while still using the OracelDataTable since I need to allow the user to update the data through a wired grid.
CREATE TABLE B_TJOTR
(
N FLOAT(126),
V VARCHAR2(10 BYTE)
)
/
SET DEFINE OFF;
Insert into B_TJOTR
(N, V)
Values
(88.1, NULL);
Insert into B_TJOTR
(N, V)
Values
(343, NULL);
Insert into B_TJOTR
(N, V)
Values
(0.00632958471747584, 'FUN');
INSERT INTO B_TJOTR
(N,V)
VALUES
(649301515676727000000000000000000000,'BIGNUMBER');
COMMIT;
Found an interesting issue with the OracelDataTable and large numbers.
If you attempt to the OracleDataTable in the standard way included in the Corelab sample within the documentation and select from the below table you'll get the following message:
Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale
I'm using the 4.50.30 build against Oracle 10gR2. Is there a work around for this type of issue, while still using the OracelDataTable since I need to allow the user to update the data through a wired grid.
CREATE TABLE B_TJOTR
(
N FLOAT(126),
V VARCHAR2(10 BYTE)
)
/
SET DEFINE OFF;
Insert into B_TJOTR
(N, V)
Values
(88.1, NULL);
Insert into B_TJOTR
(N, V)
Values
(343, NULL);
Insert into B_TJOTR
(N, V)
Values
(0.00632958471747584, 'FUN');
INSERT INTO B_TJOTR
(N,V)
VALUES
(649301515676727000000000000000000000,'BIGNUMBER');
COMMIT;
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
-
- Posts: 25
- Joined: Mon 02 Oct 2006 19:15
Ran into something interesting when binding to a grid with .ReturnProviderSpecificTypes = True
It seems as though the OracleDate value is throwing an exception.
Is there anyway to fill an OracleDataTable with .ReturnProviderSpecificTypes=true without running into the OracleDate issue below? It is almost like you'd need the ability to select a data type mapping.
Below is the error I get on the bind event.
System.Reflection.TargetInvocationException: Property accessor 'Value' on object 'CoreLab.Oracle.OracleDate' threw the following exception:'Year, Month, and Day parameters describe an un-representable DateTime.' ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
at CoreLab.Oracle.OracleDate.get_Value()
It seems as though the OracleDate value is throwing an exception.
Is there anyway to fill an OracleDataTable with .ReturnProviderSpecificTypes=true without running into the OracleDate issue below? It is almost like you'd need the ability to select a data type mapping.
Below is the error I get on the bind event.
System.Reflection.TargetInvocationException: Property accessor 'Value' on object 'CoreLab.Oracle.OracleDate' threw the following exception:'Year, Month, and Day parameters describe an un-representable DateTime.' ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.
at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
at CoreLab.Oracle.OracleDate.get_Value()
-
- Posts: 25
- Joined: Mon 02 Oct 2006 19:15
Hello,
Thanks for all of your help so far with this. After switching .ReturnProviderSpecificTypes = True the table loads. It does seem to have issues with the OracleDate when binding to a grid. That seems to have been an issue in the MS Provider while ago. I've included the link below.
I'm not sure if I'm using this feature correctly.
If I do the following,
_objDataTable = New OracleDataTable
With _objDataTable
.Connection = myConnection
.ReturnProviderSpecificTypes = True
.SelectCommand = MyCommand
.FetchAll = True
.CachedUpdates = True
.Active = False
.Fill()
End With
I now seem to have additional columns in my data grid such as MyColumnName_IsNull, MyColumnName_Lenght, MyColumnName_Value, etc. This also doesn't allow for me to edit the values within a grid on my form. Is there a method that I can use to get large numbers such as 649301515676727000000000000000000000 and still have an object that I can bind for update against a grid ( within a winform ) ?
It seems as though numbers are the only issue I've run into that causes this "Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale " issue.
Any help would greatly be appreciated since I really not sure to address this.
Oracle Date Link.
http://kbalertz.com/926357/exception-oc ... table.aspx
Thanks for all of your help so far with this. After switching .ReturnProviderSpecificTypes = True the table loads. It does seem to have issues with the OracleDate when binding to a grid. That seems to have been an issue in the MS Provider while ago. I've included the link below.
I'm not sure if I'm using this feature correctly.
If I do the following,
_objDataTable = New OracleDataTable
With _objDataTable
.Connection = myConnection
.ReturnProviderSpecificTypes = True
.SelectCommand = MyCommand
.FetchAll = True
.CachedUpdates = True
.Active = False
.Fill()
End With
I now seem to have additional columns in my data grid such as MyColumnName_IsNull, MyColumnName_Lenght, MyColumnName_Value, etc. This also doesn't allow for me to edit the values within a grid on my form. Is there a method that I can use to get large numbers such as 649301515676727000000000000000000000 and still have an object that I can bind for update against a grid ( within a winform ) ?
It seems as though numbers are the only issue I've run into that causes this "Decimal's scale value must be between 0 and 28, inclusive.
Parameter name: scale " issue.
Any help would greatly be appreciated since I really not sure to address this.
Oracle Date Link.
http://kbalertz.com/926357/exception-oc ... table.aspx
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24