Updating a table with a composite primary key using LINQ

I have a table named tblUserNetwork

. It contains composite primary key

on UserID

andConnectedToUserID

When I update the table networks.Update(networks)

, it gives an error like this:

Table dbo.tblUserNetwork contains a composite primary key field

      

What is the problem with the update.

I update many other tables, they don't have a composite primary key that they update well and well. But this is not the case, I cannot understand this problem.

Is there an ant issue with composite primary key

+2


source to share


1 answer


General reference for handling compound keys in linq .



Could you please provide some sample code for your problem?

+2


source







All Articles