473,799 Members | 2,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unformatting currency values for updating SQLServer

Have any of you good folks out there got an elegant solution for unformatting
currency values for writing back to SQLServer:

e.g.: $10,100,200.59 to 10100200.59 but for any locale and any currency.
Aug 7 '05 #1
1 2012
Yep. Just use something like

============
using System.Globaliz ation;
....
....
decimal value = Decimal.Parse(" $10,100,200.59 ", NumberStyles.Cu rrency )
============

Hope this helps.

Brian Delahunty
Ireland

http://briandela.com/blog
"crater" wrote:
Have any of you good folks out there got an elegant solution for unformatting
currency values for writing back to SQLServer:

e.g.: $10,100,200.59 to 10100200.59 but for any locale and any currency.

Aug 7 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4443
by: techy techno | last post by:
hii Experts..!! I need someone to tell me where I can get a Currency Converter like http://cconv.textor.com please can someone tell me where I can get it I need it for free + I dont need any link of the co. the code for this is here but when I change it it just says unauthorize
2
2466
by: Jack | last post by:
Hi, I have form where one has to input officer's salary along with other data. The officer's salary field is tied to a currency field in backend Access. Right now folks enter numbers e.g. 30000.00. However, when someone is writing 30,000.00 a error message comes which shows syntax error. The sql statement via response.write does not allow me to update the database. However, without the comma, things are fine. Is there any way to create a...
3
2042
by: Dave Stone | last post by:
This question appeared years ago in the context of Acc2K and SQL Server 7, but no replies were posted. HOWEVER!! It still seems to be a problem with Acc XP and SQL Server 2000. Surely someone has a fix 6 years down the line... I used the Upsizing Wizard to build a SQL database from an Access back-end and link it to the Access f/e. All the data appear to have gone across OK as viewed from Enterprise Manager, but from the front-end all...
2
12553
by: SamIAm | last post by:
I am displaying money values in a textbox like this: txtCountryPack.Text = String.Format("{0:c}", dr); I then need to updated my Database: decimal packPrice = Convert.ToDecimal(txtCountryPack.Text.Trim()); The problem is that the value is in a formatted format i.e. $300.00 How do I remove the formatting with have to do a SubString? Cheers.
11
2957
by: Adrian | last post by:
Hi I want to use the following declarations but vb dotnet keeps complaining that currency can't be used because it private ? I have tried it in a module and in the declaration pare same error! Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal
1
231
by: crater | last post by:
Have any of you good folks out there got an elegant solution for unformatting currency values for writing back to SQLServer: e.g.: $10,100,200.59 to 10100200.59 but for any locale and any currency.
2
2236
by: sck10 | last post by:
Hello, I have a SQL Server 2K table with a field set to currency. When I try to insert or update a FormView, I get the following error: Disallowed implicit conversion from data type nvarchar to data type money, table 'tblCustomer_Revenue', column 'RevenueQtr01'. Use the CONVERT function to run this query. Any help with this would be appreciated.
5
8284
by: Eric | last post by:
Java has this. Anyone know of a .Net equivalent? Thanks, Eric
18
8155
by: maxpirate | last post by:
The currency values are displayed in format of the regional settings specified in the computer of the user. I would like to display all the currency values in dollar format irrespective of the regional settings. i tried formatting the currency columns as $#.##0,00;($#.##0,00) but it still shows values in regional formats. Is there a way to specify an application specific setting.
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10482
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.