问题
Can you tell me how I can generate an ER diagram for my database1 (see below) created with VS 2015
Thanks in advance
回答1:
DB Objects in the editor will be related as in Diagram so Just relate objects in the Db and drag to editor.
回答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.
回答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.
来源:https://stackoverflow.com/questions/36531682/generating-entity-relationship-diagram-in-visual-studio-2015