471,337 Members | 948 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Inserting localized / regional setting specific data into sql serv

Hi,

We are in the process of making product in windows forms that is localized
presently for all european countries.We are supposed to support all eastern
and western european date , time and number formats.However we are currently
facing a problem that say a user in Italy uses our product and user's
settings have a "." as a time seperator sql server is unable to insert such
time values into the database.We get an error for date-time format is not
recognizable by sql server.This also gives us a problem if the date and time
seperator are both "." .Since several countries in europe do support such
settings we are in a fix.The minute any C# code at the GUI level encounters a
"." date/time seperator the Convert.ToDateTime functions fail and we are
unable to go ahead.
While doing some research for this problem we came up with a solution that
using CultureInfo.InvariantCulture to change all our date-time values before
we pass them onto Convert.ToDateTime functions . We have found this works
however what we dont understand is that we use the 120 datetime format while
inserting data into sql server, this format expects yyyy-mm-dd hh:mm:ss,
which is not what CultureInfo.InvariantCulture expects.But the queries work
perfectly inspite of that.What we are looking for is an explanation for this
since we cannot afford to release yet more patches and releases for our
product once we fix this problem we want the solution to be permanent.
Please guide us as to if the above is a solution to our problem and what is
the explanation for it, or what can be a solution to our problem.

With deepest thanks,
Niketa Mahana
Associate Consultant
Siemens Information Systems Ltd.
Feb 9 '06 #1
0 1149

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Cesar Ronchese | last post: by
4 posts views Thread by Harsha Shah | last post: by
6 posts views Thread by Niyazi | last post: by
1 post views Thread by ˴ɽ | last post: by
2 posts views Thread by Jon | last post: by
3 posts views Thread by Mark Findlay | last post: by
5 posts views Thread by =?Utf-8?B?QXhlbCBEYWhtZW4=?= | last post: by
2 posts views Thread by Gregory Gadow | last post: by
reply views Thread by rosydwin | last post: by

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.