Re: Cast is not valid
- From: "Uwa Agbonile [MSFT]" <Uwa.Agbonile@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 22 Sep 2005 10:17:53 -0700
You might want to try reading the value as a float then using the
Convert.ToDouble function to convert the value to a double such as
d = Convert.ToDouble(reader.GetFloat(index))
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Regards,
Uwa Agbonile[MSFT]
"Örjan Fjällborg" <rjan Fj llborg@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:A3419DA6-D8E6-458F-A8BC-6BC3BDEE3294@xxxxxxxxxxxxxxxx
> Hi!
>
> I get an exception (cast is not valid) when i try to use the GetDouble()
> method on a OleDataReader. I know that the field that I am reading is of
> double precision but when I watch the field in the debugger it says that
the
> ValueType is Single. How do I instruct the OleDataReader to read the field
as
> a Double instead? Is it possible?
>
> Best regards
> Örjan Fjällborg
> LKAB
.
- Prev by Date: Re: Access Linked server generates (Error 7399 / 7312)
- Next by Date: Connection string to MDF
- Previous by thread: PostgreSQL and OLEDB
- Next by thread: Connection string to MDF
- Index(es):
Relevant Pages
|
Loading