My problem is that I can connect to database and in my application everything works great and when I update a field, the changes are shown in the application but when I close and reopen the application no changes where saved, my codes are like below.
ps: my database is inside my application.
var res = db.bibleContext.Where(x => x.Book == bookF && x.Chapter == chapterF && x.Verse == verseF).FirstOrDefault();
res.favoriteverse = i;
db.Entry(res).State = System.Data.Entity.EntityState.Modified;
db.SaveChanges();
and my connection string is:
<add name="Dholybible" connectionString="Data Source=(Localdb)\mssqllocaldb;AttachDbFilename=|DataDirectory|\HollyBible.mdf;Integrated Security=True" providerName="System.Data.SqlClient" />
Here is the Solution. Before save changes, attache the local change sets to db...