Getting error with linq-to-sql in a table with a composite primary key

linq-to-sql gives me this error: "Unable to create, update or delete operations in" Table (Friend) "because it does not have a primary key." from a table with a composite primary key

+6
sql-server linq-to-sql
source share
1 answer

LINQ-to-SQL works best with a single int field as a primary key. If you have a composite primary key, it is best to create a surrogate key for this table using a single integer field.

0
source share

All Articles