Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

which sqlcedatareader method should I call for a numeric f..

 
   Database Help (Home) -> Programming RSS
Next:  How to tie table to schema?  
Author Message
newsgroup

External


Since: Jul 13, 2010
Posts: 2



(Msg. 1) Posted: Tue Jul 13, 2010 7:25 am
Post subject: which sqlcedatareader method should I call for a numeric field?
Archived from groups: microsoft>public>sqlserver>programming (more info?)

I am developing a sql server 2005 ce appliaction. I have a numeric(18,10)
filed in my db table.
When I call oReader.GetDouble(0) after oCmd.ExecuteReader() and
oReader.Read(), I got a sql exception: invalidCastException.

So I am confusing... Which other method should I call for numeric field than
GetDouble()?

Thank you in advance.

 >> Stay informed about: which sqlcedatareader method should I call for a numeric f.. 
Back to top
Login to vote
Dan Guzman1

External


Since: Aug 22, 2004
Posts: 840



(Msg. 2) Posted: Tue Jul 13, 2010 7:25 am
Post subject: Re: which sqlcedatareader method should I call for a numeric field? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> So I am confusing... Which other method should I call for numeric field
> than GetDouble()?

SQL Server numeric and decimal data types map to a .Net decimal. See
http://msdn.microsoft.com/en-us/library/4e5xt97a(VS.80).aspx for a complete
list.

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"newsgroup" wrote in message

> I am developing a sql server 2005 ce appliaction. I have a numeric(18,10)
> filed in my db table.
> When I call oReader.GetDouble(0) after oCmd.ExecuteReader() and
> oReader.Read(), I got a sql exception: invalidCastException.
>
> So I am confusing... Which other method should I call for numeric field
> than GetDouble()?
>
> Thank you in advance.
>

 >> Stay informed about: which sqlcedatareader method should I call for a numeric f.. 
Back to top
Login to vote
newsgroup

External


Since: Jul 13, 2010
Posts: 2



(Msg. 3) Posted: Tue Jul 13, 2010 10:25 pm
Post subject: Re: which sqlcedatareader method should I call for a numeric field? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you very much.

"Dan Guzman"
??????:323DE851-D0AD-4477-918D-8DC8E05583FB@microsoft.com...
>> So I am confusing... Which other method should I call for numeric field
>> than GetDouble()?
>
> SQL Server numeric and decimal data types map to a .Net decimal. See
> http://msdn.microsoft.com/en-us/library/4e5xt97a(VS.80).aspx for a
> complete list.
>
> --
> Hope this helps.
>
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
>
> "newsgroup" wrote in message
>
>> I am developing a sql server 2005 ce appliaction. I have a numeric(18,10)
>> filed in my db table.
>> When I call oReader.GetDouble(0) after oCmd.ExecuteReader() and
>> oReader.Read(), I got a sql exception: invalidCastException.
>>
>> So I am confusing... Which other method should I call for numeric field
>> than GetDouble()?
>>
>> Thank you in advance.
>>
 >> Stay informed about: which sqlcedatareader method should I call for a numeric f.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
1 Arithmetic overflow error converting numeric to data typ.. - Hi - If your stuck on a pesky Arithmetic Overflow error like I was today for about 5 hours, you, too, might be doing the same bone-head mistake I did. No shame in learning... This applies to such functions as Convert(decimal(X,Y), ExprA/ExprB) or..

character to numeric - any function can change the string "200706" into numeric 200706 Thanks

numeric fields - Hello there Is there a simple way to know if on some field of tables all the data is numeric or not?

int or Numeric - Hi all, sql 2000 sp4 Int or Numeric datatype for identity column? A table could have 100 million rows, I have always used int but, JDBC programmer wants me to use numeric. Any reason not to? thanks gv

Testing for non-numeric in the Where clause - Hi All, I need to sort on a text field that contains numbers. Trouble is they are different lengths and they sort as characters (1, 10, 11...,100, 101...). Using Cast in the Select statement works, but I can't count on the users to always enter a..
   Database Help (Home) -> Programming All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]