Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm doing a project in Visual Studio 2012 and it involves working with the given database. As I add the database.mdf to the project (asp.data folder) I got a connection error, but nothing out of the ordinary. To "repair" the database we are supposed to enter this into cmd

cd "C:\Program Files\Microsoft SQL Server\110\Tools\Binn"
SqlLocalDB.exe delete v11.0

At school everything worked fine, but at home I got this error in cmd

Delete of LocalDB instance "v11.0" failed because of the following error:
Requested operation on LocalDB instance cannot be performed because specified instance is currently in use. Stop the instance and try again.

What do I have to close/do?

share|improve this question

migrated from stackoverflow.com Nov 28 '13 at 4:12

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

You simply need to make sure you have stopped the database before deleting it.

You can check the current state by running this:

SqlLocalDb info "MyInstance"

and stop it by running :

SqlLocalDb stop   "MyInstance"

Once stopped you should be able to delete the instance.

This is a nice guide on installing and deleting express databases.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.