Page 1 of 1

Notification from untracked entity received

Posted: Tue 15 Aug 2017 15:48
by -marcelo-
I´m trying to use a DataContext to read data from the database in a using statement.
Then, when some changes are done to some entity, send the updates using code as follows.
I supposed that the Attach() method was the way to go. But even if I´m updating the (only in this case) property after the Attach(), I´m getting the exception in the subject. The source is Devart.Data.Linq.
What is the correct way? Or must I maintain the DataContext through the entire life of the application?
TIA

Code: Select all

                using (FormPrintingDataContext context = FormPrintingDataContext.Get( "nmwiu", "public" )) {
                    try { 
                        context.FormPrintingStorages.Attach(chgdinstance, readinstance);
                        chgdinstance.Definition = definition;
                    }
                    catch (Exception e) {
                        MessageBox.Show(String.Format("{0}{1}{2}", e.Message, Environment.NewLine,
                            e.InnerException != null ? e.InnerException.Message : "No more info"));
                    }
                    finally { 
                        context.SubmitChanges();
                    }
                }


Re: Notification from untracked entity received

Posted: Wed 16 Aug 2017 11:56
by Shalex
We cannot reproduce the problem in our environment.

1. Please modify the project (we just sent it to your email) to reproduce the error and send it back to us.

2. Specify the full stack trace of the error.