Link to home
Start Free TrialLog in
Avatar of websss
websssFlag for Kenya

asked on

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

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
Capture.JPG
Avatar of Rajeev
Rajeev
Flag of India image

Hi,
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:
SET DATEFORMAT DMY

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.
Avatar of websss

ASKER

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

The Set SQL construct or statement is not supported.
ASKER CERTIFIED SOLUTION
Avatar of Rajeev
Rajeev
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial