Using EF Code First and SqlCe in WPF

前端 未结 4 1909
轻奢々
轻奢々 2021-02-10 08:08

I\'m trying to use EF Code First with my WPF application , the idea is to create a SqlCe Db in AppData/MyApp (if there isn\'t one) and use it with EF Code First.

At the

4条回答
  •  面向向阳花
    2021-02-10 08:45

    I've managed to get it working after a lot of messing around. My app.config has the following:

    
    
      
      
    
      
        
      
    
      
        
          
          
        
      
    
    
    

    Having the DbProviderFactory in there will help when it comes to deployment too. It will allow users to use SQLCE 4 without running the installer for it (providing you supply the native binares as well, some info here: http://erikej.blogspot.com/2011/02/using-sql-server-compact-40-with.html).

提交回复
热议问题