Using Entity Framework with an SQL Compact Private Installation

后端 未结 5 1802
南旧
南旧 2020-11-28 21:53

I am using Entity Framework 4 in a desktop application with SQL Compact. I want to use a private installation of SQL Compact with my application, so that my install

5条回答
  •  佛祖请我去吃肉
    2020-11-28 22:54

    I figured out how to do it, thanks to a blog post by Steve Lasker. Basically, here is what you have to do:

    (1) Set a reference to System.Data.SqlServerCe.dll in your project. Set the CopyLocal property to True.

    (2) In the App.config for your project, add the following XML markup. It tells EntityFramework to look to your private installation of SQL Compact for its data provider:

    
        
            
            
        
    
    

    (3) In the Setup project, add the following files to the Application Folder in the File System Editor:

    • sqlcecompact35.dll
    • sqlceme35.dll
    • sqlcese35.dll
    • System.Data.SqlServerCe.Entity.dll

提交回复
热议问题