G
Guest
Greetings,
I have data values that are inherently of type Double. Current we are using
Oracle Column Datatype NUMBER. When I create a TableAdapter in VS2005, the
database table column information is read from Oracle and a new Table is
created. However, the detected datatypes are always Decimal. Even if I
change the datatype in the Database to a lower precision that would not
exceed the precision of a Double, it is always detected as a Decimal. This
forces me to cast everywhere, making the strongly-typed dataset, not as
useful.
Option 1: Now you might wonder, why not just change the datatype after the
table is created. This does in fact work, but if you alter the Select
statement later, the table is regenerated and since the datatypes no longer
match what was found in the database, new columns are added with a "1"
appended to the column name, which wrecks everything. So, I have to delete
all the columns first, then make my SQL change, then go back and change all
the datatypes back to what I need them to be. This sucks.
Option 2: Use the new Oracle 10g BINARY_DOUBLE column datatype. This would
be the preferred solution, but Microsoft apparently does not support it.
Even though this may be perfectly matched with the precision of a
System.Double.
Option 3: Microsoft should detect the Precision and Scale of the NUMBER
datatype in Oracle and use the appropriate .NET datatype instead of always
using Decimal. I believe this is done is other MS products via ODBC, but not
here...
Question: Is there ANY numeric datatype I can use in Oracle that will be
detected by the the MS Oracle Data Provider as a System.Double in the
Strongly-Typed representation?
I fear this answer is no. If it is, Microsoft should provide a hotfix to
allow Option 2 or Option 3 to work. Without one of these solutions,
maintenance will be a big pain. Other developers on my team, should be able
to go into the Query Builder, check off a new column for the Select
statement, and this should just add the new column, but this doesn't work.
It makes a mess, and can go almost unnoticed until you build and a list of
cast exceptions appears... Hence the big pain.
-Valkyrie-MT
I have data values that are inherently of type Double. Current we are using
Oracle Column Datatype NUMBER. When I create a TableAdapter in VS2005, the
database table column information is read from Oracle and a new Table is
created. However, the detected datatypes are always Decimal. Even if I
change the datatype in the Database to a lower precision that would not
exceed the precision of a Double, it is always detected as a Decimal. This
forces me to cast everywhere, making the strongly-typed dataset, not as
useful.
Option 1: Now you might wonder, why not just change the datatype after the
table is created. This does in fact work, but if you alter the Select
statement later, the table is regenerated and since the datatypes no longer
match what was found in the database, new columns are added with a "1"
appended to the column name, which wrecks everything. So, I have to delete
all the columns first, then make my SQL change, then go back and change all
the datatypes back to what I need them to be. This sucks.
Option 2: Use the new Oracle 10g BINARY_DOUBLE column datatype. This would
be the preferred solution, but Microsoft apparently does not support it.
Even though this may be perfectly matched with the precision of a
System.Double.
Option 3: Microsoft should detect the Precision and Scale of the NUMBER
datatype in Oracle and use the appropriate .NET datatype instead of always
using Decimal. I believe this is done is other MS products via ODBC, but not
here...
Question: Is there ANY numeric datatype I can use in Oracle that will be
detected by the the MS Oracle Data Provider as a System.Double in the
Strongly-Typed representation?
I fear this answer is no. If it is, Microsoft should provide a hotfix to
allow Option 2 or Option 3 to work. Without one of these solutions,
maintenance will be a big pain. Other developers on my team, should be able
to go into the Query Builder, check off a new column for the Select
statement, and this should just add the new column, but this doesn't work.
It makes a mess, and can go almost unnoticed until you build and a list of
cast exceptions appears... Hence the big pain.
-Valkyrie-MT