I have a problem using a local SQL Server CE database with C# and EF.
I have a new created database file with one table and three columns. I add some data by using EF. My program, that adds the data, can read that data.
If I open the table with vs2010 the tables are empty. After that I start my program again and now there are no data too.
Anyone an idea what is going wrong here?
Bye
Go to properties of Sql CE database and set Copy To Output to “If newer”
Check ones you run the program and updates added go to
$projectname$\bin\Debugor\Releaseand check database in there.Reason behind this:
Default properties of Normal a database file has Build Action set to “Content” and Copy To Output option set to “Copy Always”. then every time you build, your database from Visual Studio project is copied to your build or release folder and overwrites your existing database with the data added at runtime.