Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Alan Mills
Alan Mills
31,712 Points

Is there a way to Create/Drop Databases in Visual Studio w/o firing up an installed instance of SQL Server MgmtSuite?

This question stems from the Entity Framework Basics course. As I'm executing DropCreateDatabaseAlways (per course), I'm required to end the task of SQL Server running on my computer. Even though, SSMS the application is not running on the foreground. If I don't end this task, I cannot drop the DB via visual studio script. I will get an error stating that the table is still in use. Does anybody have insight on what application setting I can investigate to resolve this headache ? Thanks !

1 Answer

Steven Parker
Steven Parker
231,269 Points

From inside VS, if you open the "Server Explorer" and then expand "Data Connections", when you right-click a database name one of the options should be "Delete".

Also, if you right-click on "Data Connections" itself, one of the options should be "Create New SQL Server Database...".