Entity Framework 4 and SQL Compact 4: How to generate database?

Posted by David Veeneman on Stack Overflow See other posts from Stack Overflow or by David Veeneman
Published on 2011-03-05T17:02:31Z Indexed on 2011/03/05 23:25 UTC
Read the original article Hit count: 243

I am developing an app with Entity Framework 4 and SQL Compact 4, using a Model First approach. I have created my EDM, and now I want to generate a SQL Compact 4.0 database to act as a data store for the model. I bring up the Generate Database Wizard and click the New Connection button to create a connection for the generated file. The Choose Data Source dialog appears, but SQL Compact 4.0 is not listed in the list of available data sources:

enter image description here

I am running VS 2010 SP1 (beta) and I have installed the VS 2010 Tools for SQL Compact 4.0. I can create a SQL Compact 4.0 data connection from the Server Explorer. It is only in the Generate Database Wizard that the 4.0 option doesn't appear. BTW, my SQL Compact 4.0 installation does include System.Data.SqlServerCe.Entity.dll. So I should have the SQL Compact components I need.

Am I doing something incorrectly, or is this a bug? Does anyone have a fix or a workaround? Thanks for your help.

© Stack Overflow or respective owner

Related posts about entity-framework

Related posts about entity-framework-4