Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,what do you think about this error?
I'm using Linq technologies (DataContext class e linqDBClass.dbml)
When I try to update a record I faced this error:
"Operation is not valid due to the current state of the object"
Update works fine except in this case:
When I try to change field value E1_Code(FK relation).
Entity1
E1_ID
E1_Attibute
E1_Code (FK -->E1_Code on E2_Code)
 
Entity2
E2_Code
E2_Description


How can I solve this problem?

Please help me.
Thanks
Posted
Updated 11-Sep-12 5:50am
v2

1 solution

You have to detach the object before changing navigation property. Although this is not straightforward. Start here: LINQ to SQL - Detach Entities[^]
 
Share this answer
 
Comments
Max Larsen 12-Sep-12 4:01am    
I suspected a solution like this.
It is not easy especially because the development is well along.
Thank you very much Zoltan
Max
Zoltán Zörgő 15-Sep-12 4:59am    
Any progress?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900