Linq to SQL: Why am I getting IDENTITY_INSERT errors?

前端 未结 7 701
长发绾君心
长发绾君心 2020-12-17 02:49

I\'m using Linq to SQL. I have a DataContext against which I am .SubmitChanges()\'ing. There is an error inserting the identity field:

Cannot insert explicit value for         


        
7条回答
  •  情深已故
    2020-12-17 03:21

    Ensure the property Auto Generated Value in your dbml for that column is set to true. If not, LINQ will attempt to default the value based on the type.

提交回复
热议问题