I try to update twice with same data but it throw exception
public void UpdateOnSubmit<T>(T data) where T : class
{
lock (_lockObj)
{
using (DataModel dx = new DataModel(this._adapter.ConnectionString))
{
dx.GetTable<T>().Attach(data);
dx.Refresh(RefreshMode.KeepCurrentValues, data);
dx.SubmitChanges();
}
}
}
the exception is
An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported.
First update is success but not in second. Thanks in advance
Regards,
Brian
Okay seem like i’ve found the solution again. I Just set DeferredLoadingEnabled to false and it work like a charm.