Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 02, 2009 12:52 AM by den2005
Dec 01, 2009 08:07 AM|LINK
Does anyone knows easiest way to solve "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."?? I am trying add new record, this error triggers after EmployeePersonalService.Add(employeePersonal)...
Inside the Add method...
Never encountered this error before...
Dec 01, 2009 09:53 AM|LINK
check these links
Dec 02, 2009 12:52 AM|LINK
Thanks for the info bloggernext, I have seen the second link and it does not work for me that approach, having compile error using this.Employee = default(EntityRef(Employee));
But I found the source of problem for this error, I am assigning Employee object retrieve from different select process to the EmployeePersonal.Employee object which is not supported.
I have resolved this problem, hopefully no more other linq problems.