G
Guest
This is a serious bug in .NET 1.1
Using SQL select one field from Oracle table,
This column Oracle data type is: Number(18),
the field value is: 235312035283022003
which is the correct value.
However, using DataReader,
(We want the end result is long type, the only way is GetDouble(reader,0))
Here is the horrible result .NET Returns:
long viewId = 0;//We want the end result is long type,
double dViewId = reader.GetDouble(0);
viewId = (long)dViewId; // we get 235312035283022016
string sViewId = dViewId.ToString("R");//we get "2.35312035283022E+17"
sViewId = dViewId.ToString("F0");//we get 235312035283022000
viewId = long.Parse(sViewId);//235312035283022000
No matter what, we cannot get the correct value:
235312035283022003
This bug happenend when double value reaching 18 digit long.
It is fine when under 17 digit.
Any known work around?
How Microsoft proved .NET is able to be mission-critical?
We are a leading Telecom company, currently reaching the buggy-threshold in
our billing system due to this bug. Any help are appreciated.
Thanks.
Jordan
Using SQL select one field from Oracle table,
This column Oracle data type is: Number(18),
the field value is: 235312035283022003
which is the correct value.
However, using DataReader,
(We want the end result is long type, the only way is GetDouble(reader,0))
Here is the horrible result .NET Returns:
long viewId = 0;//We want the end result is long type,
double dViewId = reader.GetDouble(0);
viewId = (long)dViewId; // we get 235312035283022016
string sViewId = dViewId.ToString("R");//we get "2.35312035283022E+17"
sViewId = dViewId.ToString("F0");//we get 235312035283022000
viewId = long.Parse(sViewId);//235312035283022000
No matter what, we cannot get the correct value:
235312035283022003
This bug happenend when double value reaching 18 digit long.
It is fine when under 17 digit.
Any known work around?
How Microsoft proved .NET is able to be mission-critical?
We are a leading Telecom company, currently reaching the buggy-threshold in
our billing system due to this bug. Any help are appreciated.
Thanks.
Jordan