469,354 Members | 2,149 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,354 developers. It's quick & easy.

Converting SQL Server "money" datatype to double????

Hi,
Does anyone have any good techniques on how to convert an SQL Server 2005
"money" datatype into the ASP.Net "double" datatype?

OR, should we be using "decimal" at both ends?

TIA, Randy Smith
Apr 18 '07 #1
2 15351
On Apr 18, 6:27 am, "Randy Smith" <rsm...@cta.orgwrote:
Hi,
Does anyone have any good techniques on how to convert an SQL Server 2005
"money" datatype into the ASP.Net "double" datatype?

OR, should we be using "decimal" at both ends?

TIA, Randy Smith
I think decimal will work: Decimal m = (Decimal) dr["moneydatatype"];

http://msdn2.microsoft.com/en-us/library/ms131092.aspx

Apr 18 '07 #2
On Apr 17, 11:27 pm, "Randy Smith" <rsm...@cta.orgwrote:
Hi,
Does anyone have any good techniques on how to convert an SQL Server 2005
"money" datatype into the ASP.Net "double" datatype?

OR, should we be using "decimal" at both ends?

TIA, Randy Smith
Not sure if this is what you're looking for, but it will work...

double MyDouble =
double.Parse(drdSQLDataReader.GetSqlMoney(MyOrdina l).ToString());

where MyOrdinal is the ordinal/index of the data field in the current
row.

Apr 18 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Steve | last post: by
1 post views Thread by Chumley the Walrus | last post: by
3 posts views Thread by Ghost | last post: by
4 posts views Thread by Jerry | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.