I am trying to use an existing SQL CE 4 database in my windows phone application.
I have setup the schema. Creating the context seems fine using my connection string of “Data Source=’appdata:/Items.sdf’;mode=’read only'”
However when I try to query the database I get the following error:
Incompatible Database Version. If this was a compatible file, run repair. For other cases refer to documentation. [ Db version = 4000000,Requested version = 3505053,File name = Items.sdf ]
The Items.sdf database was created using EntityFramework 4.1 Code First.
Any ideas on how to make this compatible? Should I be doing something else?
Windows Phone is using SQL Compact 3.5, not 4.0 as its engine. You’ll need to create a version 3.5-compatible file (not sure if EF can do that offhand).