Generating entity relationship diagram in Visual Studio 2015
37,907
Solution 1
DB Objects in the editor will be related as in Diagram so Just relate objects in the Db and drag to editor.
Solution 2
Ensure you installed either Microsoft SQL Server Data Tools or Microsoft Web Developer Tools in order to get the Entity Data Model Designer.
These are the steps to generate entity relationship diagram. It was tested in VS2012
- Open
Visual Studio
- Create a project or open an existing project (must be Visual Basic, Visual C# project, or Console Application)
- Right-click the project and choose
Add
->New Item…
- Under Visual C# Items select
“Data”
- Select the template
“ADO.NET Entity Data Model”
- Give it a name and click
“Add”
- Select
“Generate from database”
or“Empty model”
- If
“Generate from database”
selected enter connection info, choose the database objects and done!
The model is stored as a “.edmx”
file.
Solution 3
With Visual Studio you can create a static diagram (class diagram) but not entity relationship diagrams (for you DB). You will have to use another tool for this. For SQL server you can use SQL server Management Studio.
Author by
xAminex
Updated on August 04, 2022Comments
-
xAminex almost 2 years
Can you tell me how I can generate an ER diagram for my database1 (see below) created with VS 2015
Thanks in advance
-
xAminex about 8 yearsI can't find what you say
-
xAminex about 8 yearsNo Body has a clue ? :(
-
Shukri Gashi about 8 yearsOK. You should do relations between tables on SQL . Then when you drag tables on the visual studio editor , editor will display relations visualy same as in diagrams on SQL editor.
-
xAminex about 8 yearsthanks you @shukri gashi for your answer. I did the relations between tables on SQL, but I don't have such thing called "the visual studio editor "
-
Quantium almost 7 yearsSimple, concise. This works perfectly for me. Not only do you get an ER diagram, but if you just create a new project you also have all the POCOs.
-
Quantium almost 7 yearsSQL Server Management Studio 2016 doesn't have this feature anymore.
-
Frogger over 4 yearsI am using SQL Server Management Studio v17.9 and it has the option to create database diagrams.
-
FoggyDay about 4 yearsSSMS 18.x also has diagramming:
Object Explorer > YourDB > Database Diagrams > New Diagram
-
Tidy about 2 yearsStill a valid solution for VS2022