473,378 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 15856
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Quinet, Joel | last post by:
Hi all, I use the Win32 extension (Build 157) module with Python 2.3 to add row in a sql server 2000 sp3 DB. My problem is I can not insert data of type money in the DB. I use the following...
1
by: Steve | last post by:
I have a million record mainframe flat file that I BULK INSERT into a SQL table with CHAR(fieldlength) deined for every column to prevent import errors. Once imported I "INSERT INTO ... SELECT...
1
by: Chumley the Walrus | last post by:
I'm trying to insert a value into sql dbase, the value "amount" is a money datatype (currency). Below is the parameter for the "amount" value: cmd.Parameters.Add(New SQLParameter("@amount",...
1
by: Stephane Charette | last post by:
QUICK VERSION: How do I create an index on a field of type "MONEY"? ----------------------------- LONG VERSION: I have a table with a field of type "money". I very often need to access...
3
by: Ghost | last post by:
Hello. I have some problem to read Money Type Field from my database. I do so: I'm using SqlDataReader object to select some records and I have "float" type variable to store result. I write: ...
3
by: Sri | last post by:
In VB, to know the field type of a column stored in a recordset the command I use is If rsQuery.Fields(k).Type = adCurrency Then How will I achieve the same in ASP.net. I could not find a...
4
by: Jerry | last post by:
Is it possible to turn off the "$" and "," that appear in "money" formatted columns so I can dump the table in a numeric format? The man page hints that lc_monetary controls the formatting but I...
0
by: Norman Yuan | last post by:
I posted this issue a while ago. After moveing the ASP.NET 1.1 app to a brand new server, the same problem still there. System: Winows2003 server std. .NET 1.1 App: Invoicing system Problem:...
1
by: jonesgirl620 | last post by:
I want to select a filed that is declared as money and have the output of that select statement be decial point free. Do I use Cast?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.