开发者

Cannot find SQL Server CE 4.0 in Data Source

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开发者_如何学JAVA application, not a Web Project.


you have to update your Visual Studio 2010 to SP1 (from here) to do so. Or you can try to use this tool.


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 -

  1. Add an empty web application that I then added my dataset and reports.
  2. I then copied the rdlc's straight into my wpf project and added the dataset to a dal library to bind the data to the reports. (when creating the empty web application you can save time by giving it the same namespace as your dal library.

I know that this is a hack but it got me out of a tight spot.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜