开发者

Deploying WPF with SQL Compact 4 and Entity Framework 4?

I am setting up a WPF app with Entity Framework 4, using SQL Compact 4 as the data store. I have the files and the references set up for a SQL Compact 4.0 private deployment (per this MSDN article).

However, with SQL Compact 3.5, I had to add configuration entries to the App.config file开发者_如何学编程 (see this blog post and this article). I can't find anything on whether similar entries are required to use SQL Compact 4 with EF4 in a desktop app.

So, here's my question: Do I have to add special entries to App.config in order to use SQL Compact 4 with EF4? If so, can you point me to an article or blog post that shows them? Thanks for your help.


Found the answer in this blog post by Erik Jensen:

<system.data>    
    <DbProviderFactories>      
        <remove invariant="System.Data.SqlServerCe.4.0"/>      
        <add name="Microsoft SQL Server Compact Data Provider 4.0"    
             invariant="System.Data.SqlServerCe.4.0" 
             description=".NET Framework Data Provider for Microsoft SQL Server Compact" 
             type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1, 
             Culture=neutral, 
             PublicKeyToken=89845dcd8080cc91"/>    
    </DbProviderFactories>  
</system.data>

Thanks, Erik!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜