Visual Studio 2012 Database Diagram?

前端 未结 3 2114
滥情空心
滥情空心 2021-02-07 05:46

I have done very little in C# and am following the Head First C# book. There\'s a part in the book where it asks me to create a Database Diagram for my SQL database, but in the

相关标签:
3条回答
  • 2021-02-07 06:17

    Give SQL Server Management Studio a try. It has a table diagram tool. Here's the express edition (SQL Server 2008 Express): http://www.microsoft.com/en-us/download/details.aspx?id=7593

    You can find it for 2012 SP1 here, as well: http://microsoft.com/en-us/download/details.aspx?id=35579

    0 讨论(0)
  • 2021-02-07 06:19

    I like the way Entity Framework 5 will allow you to import database objects and then it will diagram the tables, indexes, relationships, etc. Or you can do it the other way, create the diagrams and then publish it to a database. This works so well I suspect it is why the Database Diagram was dropped in SQL Server. EF5 is probably in your Visual Studio environment right now.

    EF5

    To create an EF5 diagram, right click a directory (usually the directory is named "Model"), and select "Add" / "New Item" and then select "ADO.NET Entity Data Model". Name it, and then select "Generate from database". The rest is selecting or generating a connection string and then selecting the database objects.

    Best part is that this is the start of what I would recommend when you get to the point in your learning where you need a data access layer, I can not recommend EF5 high enough.

    0 讨论(0)
  • 2021-02-07 06:30

    I just solved a similar problem - my VS2012 server explorer was not showing Database diagrams

    The problem was that the database I was using was the SQLEXPRESS installed by VS2012 (and was sql 2012 based)

    I am using SSMS 2008R

    When I moved the offending database to a SQL 2008R2 server - my database diagrams appeared

    This took many hours to resolve and I hope this note helps somebody else save this frustration

    0 讨论(0)
提交回复
热议问题