We added a LinqConnec to SQLlite diagram, and using the datacontext everything loads fine but making changes to any of the objects does not save. GetChangeSet() returns no records to be updated either.
We get the list similar to this (this is not the actual code just typed by hand example):
using(var db = ItemsDataContext(connectionString))
{
db.ObjectTrackingEnabled = true;
var item = db.Items.FirstOrDefault();
item.Enabled = true;
var cs = db.GetChangeSet();
db.SubmitChanges();
db.Refresh(Devart.Data.Linq.RefreshMode.OverwriteCurrentValues, item); // throws exception saying detached object
}
if I do:
db.Refresh(Devart.Data.Linq.RefreshMode.OverwriteCurrentValues, item);
it throws an exception saying that "Can't update a detached object"
So why are they detached?
var t = db.GetTable<ItemDataContext.Items>();
it says t.IsReadOnly is true?
My connection string is simply "Data Source=ItemData.sqlite"
data context object changes not being saved SQLlite
-
- Posts: 1
- Joined: Tue 22 Sep 2015 22:04
Re: data context object changes not being saved SQLlite
We have contacted you by e-mail.