Entity Framework CTP 4. “Cannot insert the value NULL into column” - Even though there is no NULL value

前端 未结 9 1600
情深已故
情深已故 2020-12-05 06:21

Im using EF CTP 4. I have a simple console app (for testing purposes) that is using EF to insert some data into a SQL database.

I have come to a problem where by upo

9条回答
  •  生来不讨喜
    2020-12-05 06:41

    It happened to me when I had a primary key missing on the respected column (the identity column) in the db's schema. I exported data between SQL servers, using SSMS Export tool and creating a new database, but didn't realize that it's exporting only the data, without keys.

提交回复
热议问题