3

My asp.net website locally uses dots as decimal separator (100.55), on my deployment server the SQL Server uses dots as separators, but the Asp.net website changes it to a comma (100,55)

Now the problem I am having is that when I try top do an update from the website the SQL query fails (because of the comma). First I thought ok easy, change regional settings and restart website. That didn't work, so I restarted the server, that didn't work either. Then I changed the .NET Globalization Settings, which also didn't work.

I have SQL Server 2012 and IIS 8.

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Donald Jansen
  • 1,877
  • 4
  • 21
  • 38

4 Answers4

5

go to this link and change your IIS setting for Your website:

Edit .NET Globalization Settings (IIS 7)

this works for IIS 8. you must change Culture and UICulture and set enableClientBasedCulture True

Asieh hojatoleslami
  • 3,042
  • 7
  • 30
  • 45
1
 <system.web>
<globalization uiCulture="en" culture="en-US" />

Use this in we config to Solve the problem convert ',' to '.' .

0

ASP.NET has its own globalization settings, which is independent of IIS,

http://msdn.microsoft.com/en-us/library/c6zyy3s9(v=vs.100).aspx

Lex Li
  • 56,623
  • 8
  • 112
  • 139
  • I've tried that, but still my numbers are formatted as x,yz where it needs to be formated as x.yz; the numbers are either of type float, double or decimal. – Donald Jansen Dec 05 '14 at 05:05
  • Then you have done what you can do on IIS/ASP.NET side. Check if you have configured SQL/SQL Server properly. – Lex Li Dec 06 '14 at 03:51
0

Updating Regional settings of an account using registry:

  1. Open Regedit.

  2. To get the SID, navigate to HKLM\SOFTWARE\Microsoft\Windows NT\ProfileList

Browse to every folder below and using the value in ProfileImagePath, you can determine the correct user account.

Then use the SId of the folder.

Image

  1. Once you have the GUID, browse to: HKEY_USERS\<SID in step 2>\Control Panel\International

Change the string values, for Decimal, change the sDecimal value

kRiZ
  • 2,265
  • 4
  • 27
  • 39
Ronald
  • 11
  • 2