Marty
Marty

Reputation: 2963

Entity Data Model Designer not showing tables

I am trying to create a Entity Data Model via an existing database,

So i follow these steps in visual studio 2010:

  1. Add new Item->Entity Data Model
  2. Select "Generate From Database"
  3. Select a connection string, test the connection string and its ok
  4. Select the tables, stored procs etc to import, no tables show up at this point, but i do check the "tables" selection - im assuming tho that it should list my tables here.

Then after these steps the Entity Data Model visual tool (ie. double click on .edmx file) shows no tables - i have tables in my database, and the username and pass im using to connect has permissions to access these tables ok.

thanks.

Upvotes: 11

Views: 14973

Answers (3)

David Mendez Guardado
David Mendez Guardado

Reputation: 40

I had the same problem, I solved adding in the DataConnection filter adding all the schemas, I don't now exactly what table has missing index or primary keys, etc, but doing this solved my problem, and shows all the data.

Upvotes: 0

user2415339
user2415339

Reputation: 191

I also had a similar problem. But in my case, it was due to missing Primary Key in the selected table. So, I added a primary key, and updated the model from the Database. After that, I could see the table, and all the columns!

Upvotes: 12

James Lawruk
James Lawruk

Reputation: 31337

Open your edmx file in a text editor. If you see the tables in the file but not in the designer, try clearing out all the EntitySet nodes and EntityType nodes, save the file, then go back to Visual Studio and try the Update Model from Database again.

<edmx:StorageModels>
    <Schema Namespace="myModel.Store">
        <EntityContainer Name="MyModelStoreContainer">
            delete-> <EntitySet Name="Table1" ... />
            delete-> <EntitySet Name="Table2" ... />
        </EntityContainer>
            delete-> <EntityType Name="Table1">...</EntityType>
            delete-> <EntityType Name="Table2">...</EntityType>
  </Schema></edmx:StorageModels>

Upvotes: 14

Related Questions