10

Can you tell me how I can generate an ER diagram for my database1 (see below) created with VS 2015

enter image description here

Thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
xAminex
  • 393
  • 2
  • 6
  • 18
  • I have outlined the steps on how to create the `Entity Relationship Diagram` with visual studio from your existing database in an answer below. Let me know if it solves your problem – Chidi Ekuma Mar 09 '17 at 16:28

3 Answers3

24

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

  1. Open Visual Studio
  2. Create a project or open an existing project (must be Visual Basic, Visual C# project, or Console Application)
  3. Right-click the project and choose Add -> New Item…
  4. Under Visual C# Items select “Data”
  5. Select the template “ADO.NET Entity Data Model”
  6. Give it a name and click “Add”
  7. Select “Generate from database” or “Empty model”
  8. If “Generate from database” selected enter connection info, choose the database objects and done!

The model is stored as a “.edmx” file.

Chidi Ekuma
  • 2,811
  • 2
  • 19
  • 30
1

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.

Ghaag
  • 138
  • 2
  • 11
-4

DB Objects in the editor will be related as in Diagram so Just relate objects in the Db and drag to editor.

Shukri Gashi
  • 535
  • 2
  • 10