Linq sql Attach, Update Check set to Never, but still Concurrency conflicts

Posted by remdao on Stack Overflow See other posts from Stack Overflow or by remdao
Published on 2010-04-09T12:31:38Z Indexed on 2010/04/09 12:33 UTC
Read the original article Hit count: 386

Filed under:
|
|
|

In the dbml designer I've set Update Check to Never on all properties. But i still get an exception when doing Attach: "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." This approach seems to have worked for others on here, but there must be something I've missed.

        using(TheDataContext dc = new TheDataContext())
        {
            test = dc.Members.FirstOrDefault(m => m.fltId == 1);
        }

        test.Name = "test2";

        using(TheDataContext dc = new TheDataContext())
        {
            dc.Members.Attach(test, true);
            dc.SubmitChanges();
        }

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about sql