Deploying WPF with SQL Compact 4 and Entity Framework 4?

I am configuring a WPF application with Entity Framework 4 using SQL Compact 4 as the data store. I have files and links configured for a private deployment of SQL Compact 4.0 (for 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 cannot find anything about whether similar records are needed to use SQL Compact 4 with EF4 in a desktop application.

So, here is my question: do I need to add special entries to App.config to use SQL Compact 4 with EF4? If so, can you point me to an article or blog post that shows them? Thank you for your help.

+3
source share
1 answer

Found the answer to this post on Eric Jensen's blog :

<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 Eric!

+2
source

All Articles