I have an application that needs to run in a server with specific regional
settings (South America). In some part of the code, i'm retrieving values
like "25,94" (that means... 25 as the integer part, 94 as the decimal
part.... using a ",").
The problem is that when i concatenate those values to build another sql
query, like an insert.... the "," is completely messing up the query.
How can i convert those values to use a "." instead... without using dirty
things like replacing "," by "."?
tnx. 2 1019
Hi,
The first advice is use command.parameters instead of concatenating values
to a select statement. (I did not try this in this case, but it seems to me
the normal solution for this question)
Cor I have an application that needs to run in a server with specific regional settings (South America). In some part of the code, i'm retrieving values like "25,94" (that means... 25 as the integer part, 94 as the decimal part.... using a ",").
The problem is that when i concatenate those values to build another sql query, like an insert.... the "," is completely messing up the query.
How can i convert those values to use a "." instead... without using dirty things like replacing "," by "."?
tnx.
"Toble Rone" <to****@yahoo.com.ar> schrieb I have an application that needs to run in a server with specific regional settings (South America). In some part of the code, i'm retrieving values like "25,94" (that means... 25 as the integer part, 94 as the decimal part.... using a ",").
The problem is that when i concatenate those values to build another sql query, like an insert.... the "," is completely messing up the query.
How can i convert those values to use a "." instead... without using dirty things like replacing "," by "."?
First, convert the string to a Decimal or Double. Use Decimal.Parse or
Double.Parse. If the string is in a format different from the current
regional settings, you can specify a second arg.
In an SQL query, use the Parameters property to pass the Decimal/Double
value. It does the formatting for you.
--
Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Duncan Smith |
last post by:
I am having problems saving arrays to file. e.g.
>>> t1
array()
>>> t2
array()
>>> t3
array()
>>> t4
array(,
|
by: JuniorLinn |
last post by:
Hi there - I would like to share this strip of code with our SQL 2000
DBA community. The code below strips all non-numeric characters from a
given string field and rebuilds the string. Very...
|
by: BBFrost |
last post by:
I'm receiving decimal values from database queries and placing them on a
report page.
The users want to see the following ....
Db Value Display Value
123.3400 123.34...
|
by: Keith |
last post by:
I apologize for those of you who think I'm posting on the same topic. It is not that I don't appreciate all of your comments - and I'm definitely reading them all - but I think I have a differing...
|
by: M.A. Oude Kotte |
last post by:
Hi All,
I hope this is the correct mailing list for this question. But neither
postgresql.org nor google could help me out on this subject.
I did find one disturbing topic on the mailing list...
|
by: AdamM |
last post by:
Hi all,
What function lets me check a text string and determine if that string is really a int, float, double, etc. just formatted as a string?
Thanks in advance!
Adam
|
by: Brian Blais |
last post by:
Hello,
I have a string input from the user, and want to parse it to a number, and would like
to know how to do it. I would like to be able to accept arithmetic operations, like:
'5+5'...
|
by: nishit.gupta |
last post by:
Is their any fuction available in C++ that can determine that a string
contains a numeric value.
The value cabn be in hex, int, float. i.e. "1256" , "123.566" ,
"0xffff"
Thnx
|
by: Mike |
last post by:
I use MS SQL EXPRESS DB
VS 2005, c#
Win Application
I have problem "The string is non-numeric"
with formula
CDbl({pr_DajPonudu;1.KolicinskiPopust})/100 * {@NajamProstora}
|
by: engteng |
last post by:
How do I convert string to numeric in VB.NET 2003 ?
Example convert P50001 to 50001 or 50001P to 50001 but if P is in middle
then not convert.
Regards,
Tee
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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,...
| |