GetFloat
Old forum URL: forums.lhotka.net/forums/t/583.aspx
DesNolan posted on Monday, July 10, 2006
Hi,
I have a Float field in my database, which my query returns ok, but
when I try to use the GetFloat method of the SafeDataRead to assign the
value to a private Float field on my BO the system throws an
InValidCast exception. Using GetDouble works for me, but not sure why
GetFloat won't. Anyone have any ideas?
Thanks,
Des Nolan
(using CSLA to build an 'open' version of a Disaster Recovery Planning product)
ajj3085 replied on Tuesday, July 11, 2006
Sql data types don't map directly to .Net datatypes. A float in Sql likely has a greater percision than a float in .Net, hence the need for double. Floats in .Net have a 7 digit percision; doubles have 15 - 16.
HTH
Andy
DesNolan replied on Tuesday, July 11, 2006
Andy,
I will check that out.
Thanks,
Des Nolan
Copyright (c) Marimer LLC