Click here to Skip to main content
12,253,139 members (45,130 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB LINQ VB.NET ASP.NET4
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 11-Sep-12 5:44am
Edited 11-Sep-12 5:50am
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You have to detach the object before changing navigation property. Although this is not straightforward. Start here: LINQ to SQL - Detach Entities[^]
  Permalink  
Comments
Member 4578042 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160426.1 | Last Updated 11 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100