最佳答案
这件事快把我逼疯了,这个错误对我来说毫无意义:
无法更新 EntitySet‘ TableB’,因为它有一个 Definition ingQuery,而且元素中不存在支持当前操作的元素。
My tables are put like this:
TableA int idA (identity, primary key) ... TableB int idA (FK for TableA.idA) int val
TableB has no defined primary key in the SQL server. The Entity Framework has imported the table and the association and set both fields as key. But it will output that error when I try to do an insert into the table!
What's wrong??
编辑: 正如亚历克斯所建议的,解决方案是这样的:
我让键保持原样,因为对我来说两列都是键的一部分是可以的。