Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot drag tables from model browser into edmx design surface

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

like image 580
jstuardo Avatar asked Sep 03 '16 00:09

jstuardo


People also ask

How do I manually edit EDMX?

edmx file open in Visual Studio, you should be able to simply right-click on a table or a column in the table and choose 'rename'. Once you change the name it will be reflected in the Mapping Details window. Problem is that's editing the entity names and properties, not the underlying SQL tables and columns.

How to add new table mapping in edmx?

To add new table mapping, you need to add new entity to .edmx designer by right clicking on .edmx designer and choosing the option to add new entity from the menu as shown below :

What is edmx designer Entity Framework mapping?

As we know that .edmx designer entity framework mapping is generated either from ‘Database First Approach’ or from ‘Model First Approach’ (in case ‘Code First Approach’ there is no .edmx designer file generated ). In these cases, EF Designer .edmx corresponds to ORM mapping to database tables.

How do I add an object to edmx file?

In the Model Browser, right-click the.edmx file and select Update Model from Database. Expand the Tables, Views, and Stored Procedures nodes, and check the objects you want to add to the.edmx file. Click the Add tab. Nodes for tables, views, and stored procedures are displayed.

How do I use the model browser in EDM designer?

To open the Model Browser, right click the empty surface of the EDM designer and select Model Browser from the context menu. Model Browser will appear in the area where you normally find Solution Explorer and Properties.


1 Answers

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
like image 66
Nagaraj Raveendran Avatar answered Oct 22 '22 19:10

Nagaraj Raveendran