WCF Data Service Exception
Posted
by Ravi
on Stack Overflow
See other posts from Stack Overflow
or by Ravi
Published on 2010-05-20T04:28:28Z
Indexed on
2010/05/20
5:00 UTC
Read the original article
Hit count: 874
wcf
|wcf-data-services
Hi,
I am working on C#.Net with ADO.NET Dataservice WCF Data Services.
I try to update one record to relational table, when I reach context.SetLink()
I am getting exception("The context is not currently tracking the entity")
. I don't know how to solve this problem. My code is specified below.
LogNote dbLogNote =logNote;
LogSubSession dbLogSubSession = (from p in context.LogSubSession
where p.UID == logNote.SubSessionId
select p).First<LogSubSession>()
as LogSubSession;
context.AddToLogNote(dbLogNote);
dbLogNote.LogSubSession = dbLogSubSession;
context.SetLink(dbLogNote, "LogSubSession", dbLogSubSession);
context.SaveChanges();
Here LogSubSession
is a primary table and LogNote
is a foreign table. I am updating data into foreign table based on primary key table.
Thanks
© Stack Overflow or respective owner