3

I'm trying to deploy my .NET MVC3 application without success. I have a datetime issue I'm not able to fix. Let me try to explain :

I have installed Microsoft visual web developper 2010 in French. My localization in control panel is French. When I code first my model and try to deploy my app I can see that my tables are created with SQL_Latin1_General_CP1_CI_AS collation which means English localization !??! Then I have, of course, a datetime issue with my production database. How can I change the collation of my SQLserver Compact database in dev to match my production database ? Why EF is creating my tables with english collation ??

Thanks for your help

tereško
  • 58,060
  • 25
  • 98
  • 150
Dude Lebowski
  • 159
  • 1
  • 10
  • 1
    possible duplicate of [Entity Framework Code First - Change Table Column Collation](http://stackoverflow.com/questions/5285781/entity-framework-code-first-change-table-column-collation) – Erik Funkenbusch Mar 14 '12 at 14:44
  • Not a duplicate, linked question is to change collation for a specific column, this relates to changing the default collation for the entire database – Patrick McDonald Apr 12 '12 at 10:44

1 Answers1

2

Acccording to http://msdn.microsoft.com/en-us/library/ms174596(v=sql.90).aspx

All databases that are created without specifying the Windows collation name are assigned Latin1_General, the default collation. Example: Latin1_General_CI_AS. This collation uses the Latin1 General dictionary sorting rules, code page 1252. It is case-insensitive and accent-sensitive.

As EF does not seem to support customizing this, I would suggest, if it's an option for you, to install SQL Server Express and use this instead, as SQL Server Express supports alternative default collations.

Patrick McDonald
  • 64,141
  • 14
  • 108
  • 120