Entity Framework Designer refuses to create a table

entity-framework

Question

I have a simple table named ZipCodes that contains ZipCode, City and State. I create a new class library project, add an ADO.NET Entity Data Model to the project, Select the ZipCodes table from the database, pick the connection string, check the box next to the ZipCodes table and click "Finish" and it generates the edmx and Designer.cs files... but no ZipCodes. The table definition is not on the designer screen and it is not in the .cs file. How can this be?

1
11
11/15/2011 9:50:17 PM

Popular Answer

Burried in the edmx file is a comment:

Errors Found During Generation: warning 6013: The table/view 'Common.dbo.ZipCodes' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.

22
11/16/2011 4:18:50 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow