473,394 Members | 1,854 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,394 software developers and data experts.

number format

Hi,

Our thousand seperator is period, and decimal seperator is comma.

so a number looks like this: 1.456,60

formatnumber() produces above format.

When entering this value into database, I get error, because comma is
also used by SQL to separate records.

If the number is smaller than thousand, I can solve thi sby replacing
comma with period. but when the number is thousand or greater, I cant
fix it.

Can anyone tell me a workaround for this please?

Sep 23 '08 #1
4 3509
"M. Savas Zorlu" <sa***@zorlumail.comwrote in message
news:O0**************@TK2MSFTNGP05.phx.gbl...
Hi,

Our thousand seperator is period, and decimal seperator is comma.

so a number looks like this: 1.456,60

formatnumber() produces above format.

When entering this value into database, I get error, because comma is also
used by SQL to separate records.

If the number is smaller than thousand, I can solve thi sby replacing
comma with period. but when the number is thousand or greater, I cant fix
it.

Can anyone tell me a workaround for this please?

Stop using formatnumber for this job. Also you are probably using string
contentation to build up your SQL string including the parameter. Stop
doing that as well. Use a command object and add parameters for the
appropriate type.

--
Anthony Jones - MVP ASP/ASP.NET

Sep 23 '08 #2
Hi Anthony,

Can you please explain string contentation? and can you please give an
example of using a command object?

regards,

Savas

Anthony Jones wrote:
"M. Savas Zorlu" <sa***@zorlumail.comwrote in message
news:O0**************@TK2MSFTNGP05.phx.gbl...
>Hi,

Our thousand seperator is period, and decimal seperator is comma.

so a number looks like this: 1.456,60

formatnumber() produces above format.

When entering this value into database, I get error, because comma is
also used by SQL to separate records.

If the number is smaller than thousand, I can solve thi sby replacing
comma with period. but when the number is thousand or greater, I cant
fix it.

Can anyone tell me a workaround for this please?


Stop using formatnumber for this job. Also you are probably using
string contentation to build up your SQL string including the
parameter. Stop doing that as well. Use a command object and add
parameters for the appropriate type.
Sep 23 '08 #3
"M. Savas Zorlu" <sa***@zorlumail.comwrote in message
news:u0**************@TK2MSFTNGP05.phx.gbl...
Hi Anthony,

Can you please explain string contentation?
sSQL = "UPDATE myTable SET myField = " & myNumber

The problem is if myNumber is ultimately supplied by the client a malicious
person can inject SQL code that will do bad things. Search google for SQL
Injection.
and can you please give an example of using a command object?
See this:-
http://msdn.microsoft.com/en-us/library/ms524771.aspx

--
Anthony Jones - MVP ASP/ASP.NET

Sep 23 '08 #4
Thanks Anthony

Anthony Jones wrote:
"M. Savas Zorlu" <sa***@zorlumail.comwrote in message
news:u0**************@TK2MSFTNGP05.phx.gbl...
>Hi Anthony,

Can you please explain string contentation?

sSQL = "UPDATE myTable SET myField = " & myNumber

The problem is if myNumber is ultimately supplied by the client a
malicious person can inject SQL code that will do bad things. Search
google for SQL Injection.
>and can you please give an example of using a command object?

See this:-
http://msdn.microsoft.com/en-us/library/ms524771.aspx
Sep 23 '08 #5

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

Similar topics

0
by: martin.mrazek | last post by:
Hello, I wanted to install Number::Format module bud ended up with following error message. Does anybody have any suggestion what the cause could be?? Could that be due to presence of perldl in my...
1
by: Michelle Hillard | last post by:
Hi guys, would appreciate if you can shed some light on this. Sorry to be a pain, can you tell me what is wrong with the following: for /F %%i in ('dir /b /on c:\bcp\pc*.txt') do bcp...
0
by: johkar | last post by:
My XML and XSL is below. Also below is a textual representation of what I want to get out of the XML with XSL. For each Extension node in XML, I am only concerned with those nodes with...
2
by: Richard Haber | last post by:
I am using format-number(-1234.56,'#,##0.00;(#,##0.00)') in a stylesheet that works in every xsl processor (including MSXML2) except for the one in ..NET 1.1. I am expecting to see (1,234.56) as...
13
by: jm | last post by:
I am trying to use datepart to get the real name of the month like "April" or "APR" not just "4." I could not find it in the documentation. Sorry. Thank you.
1
by: crowl | last post by:
Hi all, I want to have a number in a certain format. I took a look in the msdn and was happy to find the format-number Function. This works fine. But unfortunately, I can't find the format...
5
by: Kamaluokeakua | last post by:
I have to write an application that deals with clients in multiple countries. The addresses, phone numbers, country id and currency information has to be stored into a database that allows for the...
6
by: Jovo Mirkovic | last post by:
Hi, I have to make a program which will generate 100,000 different ID numbers (for example 2345-9341-0903-3432-3432 ...) It must be really different, I meen it can not be a similar (like...
6
by: JFB | last post by:
Hi all, How can I format a fax number as 888-333-444? The number is coming from database as 8883334444 <ItemTemplate> <%#container.dataItem("cfax")%> </ItemTemplate> Tks JFB
10
by: Dixie | last post by:
I am appending some new fields to a table in vba and when I append a number field with is a byte, it does not inherit any format. I want it to be the General Number format, but it is blank. I...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
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...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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 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.