Recently I decided to move to another server. Now my application runs on different servers with different culture (IT and EN).
Everything worked fine but now i am facing many problems with date and numbers.
The main problem seems to be SQL Server. In fact, SQL SERVER throws errors. I solved the problem with date using the method ParseExact:
e.Command.Parameters["@Expiry"].Value =
DateTime.ParseExact("31/12/2099", "dd/MM/yyyy", null);
For decimal numbers i have to swap "." and "," (depending of the culture) if i want the application to work:
Latitude.Value = Latitude.Value.Replace(".", ","); //ONLY for ITALIAN CULTURE
e.Command.Parameters["@Latitude"].Value = Latitude.Value;
I repeat: the errors are generated by SqlServer. Is there any way to set the culture once for all?
PS: the EN server is GoDaddy Hosting.
UPDATE: The problem is pure Sql Server. In fact, checking on my servers, I found a ',' on the first one and a '.' on the second one as separators for money and decimals.I found: ALTER LOGIN 'MYDBLOGIN' WITH DEFAULT_LANGUAGE = Italian; GO
With the previous query i was able to change the culture on sql server. However, the problem is still there.