Reputation: 20036
I have both SQL Server CE 3.5 and 4.0 installed. In VS2010 WPF, when I add new connection and want to create a database with SQL Server CE 4.0, I only see Microsoft SQL Server Compact 3.5, but not 4.0.
Why?
This is a WPF desktop application, not a Web Project.
Upvotes: 2
Views: 2253
Reputation: 366
I ran into same problem lately when trying to add rdlc reports to my WPF application, and unfortunately you cannot add a compact 4.0 dataset to WPF project.
My workaround was to -
I know that this is a hack but it got me out of a tight spot.
Upvotes: 2
Reputation: 4420
Using SQLCE40 in VS2010 is going to be little bit of a challenge.
When you update to SP1 you will find that when go to "add" a local db to your project there is a selection for "SQL Server Compact 4.0 Local Database".
If you create a SQLCE40 local database and then try to "Add" "Existing Item..." to your project and select your existing SQLCE40 local database you will get a warning about it not being supported in the project type if it is not of a web project type.
Erik's SQL Server Compact Toolbox makes the challenge using SQLCE40 in VS2010SP1 much more manageable, especially if you're trying to use it using a non-web project type.
Upvotes: 1
Reputation: 14387
you have to update your Visual Studio 2010 to SP1 (from here) to do so. Or you can try to use this tool.
Upvotes: 2