I have a Code First project with Entity Framework 5.0.0 using localdb created in Visual Studio 2012 Ultimate.
Although I can see my class relations in a Class Diagram, how to see a visual diagram of automatic generated database by EF ?
Install Entity Framework Power Tools Beta 4, restart Visual Studio, right-click on the context in your solution view and you'll see a new 'Entity Framework' option in the context menu. Select 'View Entity Data Model' to see a beautiful visual database diagram in Visual Studio. VoilĂ !
Entity Framework 6 Power Tools: Link
You can use Microsoft SQL Server Management Studio 2012 with localdb which supports Database Diagrams in they way you may be used to with other SQL Server database.
Open Management Studio (should have been installed with Visual Studio)
Connect to (localdb)\v11.0, with Windows Authentication
Find the relevant database
Expand Database Digrams, and install diagram support objects if you've not already
Add the tables you need and you're done!
Source: This older but still relevant article: http://visualstudiomagazine.com/blogs/data-driver/2012/05/visual-studio-11-beta-easier-development-localdb.aspx
I checked out the Entity Framework Power Tools Beta 4 and it is no longer being supported. Intead, you can use the new Entity Framework 6 Power Tools Community Edition.
It is supposed to work the same.
Related
I need a way to deploy the oracle database in a single click, something similar to SSDT projects.
Red Gate (where I work) has a set of deployment tools for Oracle, including version control, but they are not tightly integrated in Visual Studio. They were designed to be standalone as unlike for SQL Server, there are a handful of different IDEs in the Oracle scene, including Toad, SQL Developer and PL/SQL Developer.
The predecessor of SSDT had Oracle support via a Quest Extension, but this was discontinued with the release of SSDT.
Fairly long title, but hopefully self-explanatory!
I'm starting a new project in Visual Studio 2013 using Entity Framework 5.0 with code first migrations.
I've connected my project to TFS Online using git - I'm interested in trying TFS Online as it offers source control management for 5 free projects (similar to BitBucket) but with strong Visual Studio integration.
I've not used Database projects in Visual Studio 2013 and I've found little information for how this all fits together.
What I'm trying to acheive is to create a simple Visual Studio solution with 2 projects - one an MVC .NET project and the other a database project. My goal is that code first migrations will make the neccessary changes to the sql scripts in the database project (which are managed under git source control). My web.config points to a local .mdb file as my database which is what is updated when I run update-database in EF which is what I feel is the problem.
How can I point EF to use my database project for code migration, and subsequently how can I automatically build my development database into a local .mdb file when debugging my solution?
Entity Framework Code First is a way to manage your SQL Schema. The single source of the truth lives in your code base. Migrations adds a way to move from one version of the schema to another. The SQL schema is a by-product of the build process.
SQL Server Database projects are also a way to manage your SQL Schema. The single source of the truth lives in your SQL Server Database project. You can use schema compare to generate scripts that move from one version to another.
Given that these technologies overlap in their intent and functionality, it doesn't really make sense to use them together. When you're using entity Framework Code First, leverage Migrations when you can (and when the features are sufficient for your situation).
When you're unable to use Migrations, you could use SQL Server Database projects to manage the schema and keep them in source control.
Note:
You should consider installing the SQL Server Data Tools as a replacement for the SQL Server Database projects should you want to use these. The data tools are a more advanced version of these projects, even if they might require Visual Studio 2012 to run for now. I suspect a version for Visual Studio 2013 will be available when Visual Studio 2013 hits RTM
I've just downloaded VS LightSwitch and I'm doing a sample application for myself. I have created a new table by using Create new table option and have inserted some data. So after I inserted 3 records, the ID is obviously showing 3, which is correct.
Now I want to truncate the data from the table.
My question is, where is the internal table or the internal database (ApplicationData) ?
Thanks
The following steps worked for me:
From the solution folder of your sample application, open the
bin\data folder
You should see the ApplicationDatabase.mdf file
Open SQL Server Management Studio
Use the attach functionality to open the mdf file
After making your changes, detach it
It seems that LightSwitch uses SQL Server Express for its internal database. Try looking in the bin\data folder of your project for an ApplicationDatabase.mdf file.
From the official "Working with SQL Server LocalDB in LightSwitch Projects in Visual Studio 2012" (emphasis mine):
"When you create new tables, LightSwitch automatically creates them in the internal database, also known as the Intrinsic database or ApplicationData. In the first version of LightSwitch in Visual Studio 2010 we used SQL 2008 Express for the internal database development. Now with LightSwitch in Visual Studio 2012 we are using SQL Server LocalDB. (Note: LocalDB is only used during development time. When you deploy your app you can choose to deploy to any version of SQL Server.) LocalDB is the new version of SQL Server Express that has a much lower memory footprint and is targeted for developers. It is installed automatically when you install Visual Studio 11. "
I have a MS-SQL database on a server and have decided to play around with source control for the database. I want to create a database project and include that project within my solution. Is there any way to "import" an existing database into a database project in Visual Studio 2008?
I have run a few searches but I haven't really found anything of substance yet. Any ideas will be welcome!
Thanks
Yes. If you have Visual Studio 2008 Team System, then the Database Edition GDR release 2 add-on is the way to go.
You can download from here: Microsoft® Visual Studio Team System 2008 Database Edition GDR R2
You can find a list of features here.
Also, Introducing New Features In The VSTS Database Edition GDR
Update: In response to poster's comment about not having the Team System version, you can still use the original Database Project that comes with Visual Studio, but it is not as fully featured as the new GDR R2 version.
I'm trying to find a way to browse a PostgreSQL database from the Visual Studio 2008 "Server Explorer" panel. I downloaded Npgsql but as I understand that's only a library for the code itself, not the Server Explorer.
Npgsql is a .NET provider for PostgreSQL. Whether or not a given provider integrates with Server Explorer depends on whether it supports DDEX, which Npgsl as of now does not, but this support is planned for future versions.
However, if all you want to do is to be able to browse a PostgreSQL database in Server Explorer, you can do this by installing the psqlODBC, the PostgreSQL ODBC driver, and connecting via the .NET Framework Data Provider for ODBC.
alt text http://www.codingthewheel.com/image.axd?picture=postgre_sql_server_explorer.png
Also, I should mention that Npgsql DOES have some design-time integration with Visual Studio - for example you can use NpgsqlConnection objects from the toolbar and so forth.
I looked for this earlier this year and found someone that on some mailing list wrote that they were working on that for Npgsql but it not yet available.
We actually discarded Npsql and now uses dotConnect for PostgreSQL instead. It is a commercial product with a free option but you have to pay to the get the Visual Studio integration.