Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Casting ..no. must be less than infinity
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01279794
Message ID:
01279815
Views:
14
Hi Viv, thanks for replying
.... double Disc = rdr.GetDouble(index)

Doing this (using an Index) maens that if the layout of the Table is changed, this will not work and possibly wrong data will be saved.

Is there a way of using the field name in GetDouble() rather than an Index ??
Regards,
Gerard



>Use the OleDbReader.GetDouble() method
double Disc = rdr.GetDouble(index);
(rdr["Disc"] returns an object type which cannot be cast to double)
>
>>Hi. I have following code:
>>
>>double Disc = (Double)rdr["Disc"];
>>
>>and I am getting an error:
>>..When casting from a number, the value must be a number less than infinity
>>
>>This is in an OLeDBDataReader and Disc is a Numeric Field. It is poupulated with data. I have tried tis with N(1,0) and N(12,2) and get same error.
>>
>>Anybody got any ideas whats causing this ? . Character fields are not causing a problem.
>>Regards,
>>Gerard
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform