Entity Data Model Designer not showing tables

entity-framework visual-studio-2010


I'm attempting to use an existing database to develop an entity data model.

This is what I do in Visual Studio 2010:

  1. Entity Data Model — Add New Item
  2. Choosing "Generate From Database"
  3. Choose a connection string, verify it, and it's OK.
  4. No tables appear at this time, but I do check the "tables" option; I'm guessing that it should display my tables here. Select the tables, stored procs, etc. to import.

I have tables in my database, and the login and password I'm using to connect has rights to view these tables without issue. However, after completing these steps, the Entity Data Model visual tool (i.e., double clicking on the.edmx file) does not display any tables.


6/12/2012 1:23:15 AM

Accepted Answer

Use a text editor to see your edmx file. Attempt deleting all the EntitySet nodes and EntityType nodes, saving the file, then returning to Visual Studio to try the Model Update from Database again if you can see the tables in the file but not in the designer.

    <Schema Namespace="myModel.Store">
        <EntityContainer Name="MyModelStoreContainer">
            delete-> <EntitySet Name="Table1" ... />
            delete-> <EntitySet Name="Table2" ... />
            delete-> <EntityType Name="Table1">...</EntityType>
            delete-> <EntityType Name="Table2">...</EntityType>
8/12/2012 7:27:33 PM

Popular Answer

I had a same issue. However, in my situation, it was because the chosen table's Primary Key was missing. So I changed the model from the database and added a primary key. I then had a clear view of the table and its columns.

Related Questions


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