SqlCe Locale set to USA - not accepting my UK Dates - how to change locale?

websss used Ask the Experts™
i have a sqlce SDF file

If i look at the properties i see its set to united states and this is the reason its not accepting my uk dates through my vb.net app

I've tried adding the Locale in the connection string with no luck
;Locale Identifier=2057

How can i change the DB to be UK and not USA?
see attached
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You are providing the correct identifier. It should work correctly with the British Settings. But if that is not working, then you can issue the command:

Open in new window

in your connection routine (After creating a connection). This will change the dateformat setting to British for that particular session.
As commonly, we use a single routine to create connection, this change should be easy and workable for you.


I don't think that works for SQL CE as i get the error

The Set SQL construct or statement is not supported.
I searched many things. But it looks that the SQL CE database is accepting the "Locale Identifier" but it is not able to "SET" it inside the connection.

Because if we provide wrong syntax (like Locale/ Loc Identifier/...) , then it identifies that something is wrong and raises the error but otherwise, the value of Locale Identifier doesn't make any change in the forthcoming queries.

The only option that comes up right now is to change the Locale for all connections. That is in the database properties itself.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial