Cannot drag tables from model browser into edmx design surface

ado.net-entity-data-model c# entity-framework-6 odp.net

Question

I am using ODP.NET. I have added an ADO.NET model to the project. That way, an edmx file was created. I chose "create from database" and after I selected the tables and click finish, edmx design surface appeared empty, however, the model browser window showed my added tables.

The problem now is that I cannot drag & drop the tables from model browser to the design surface. Please see this screenshot:

enter image description here

1
9
9/3/2016 12:34:32 AM

Accepted Answer

Might be because of the below reasons:

  1. I believe you have to choose the "Update Model from Database..." context menu option and pick the tables from the list
  2. Ensure the table you are trying to drag and drop has primary key defined
5
10/13/2016 6:32:52 PM

Popular Answer

I guess it is Linq to SQL file, Linq to SQL file experience is bad in my case.

Instead of drag drop you need to do following

  • Right click on the EDMX designer surface. You have lot of options and among them choose the option 'Update Model from Database'.

  • Now, you will see the usual screen which has all the database objects in new window which you have seen while creating EDMX file.

  • From this windows chose the new table and generate EDMX model from it.

  • After that this model will appear in EDMX designer window.



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