Francesco
Francesco

Reputation: 964

SQL compact 4 exception

I have a windows form application written in C# and running on a Windows XP machine with SQL compact 4 database. The operating system language is simplified chinese. I'm facing a strange exception. "The specified locale is not installed on this machine. Make sure you install the appropriate language pack. LCID 1053" Why? The application does work ok on all other configurations/languages.

Upvotes: 1

Views: 600

Answers (2)

Khizar
Khizar

Reputation: 11

I had the same problem SDF created in win8 with version 4.0 and it was not working in XP.

Then I repaired the DB with the following C# code, now its working in both OSs.

SqlCeEngine se = new SqlCeEngine(@"Data Source=|DataDirectory|\mydatabase1.sdf;Persist Security Info=False;");
se.Repair(@"Data Source=|DataDirectory|\mydatabase1.sdf;Persist Security Info=False;", RepairOption.RecoverAllOrFail);

Upvotes: 1

MatthewMartin
MatthewMartin

Reputation: 33143

That is the locale for Sweden. You can change the locale by modifying the connection string:

http://msdn.microsoft.com/en-us/library/ms174034.aspx

so it would be something like

conString = "....;Locale Identifier=XXXX;..."

where the XXXX can be found on this table: http://msdn.microsoft.com/en-us/goglobal/bb964664

Upvotes: 2

Related Questions