How to disconnect to an user instance database

A

ad

I am use the AttachDbFilename to connection to a .mdf file of SqlExpress
(like the example below)
After the database is attached, it will be free again until all session time
out.

But sometime I want to move the .mdf file to another place, but the .mdf is
not free.
How can I disconnect all the connections to that database immediately?
----------------------------------------------------------------------------------------------------------------------
<add name="MyDataBase" connectionString="Data Source=VMXP\SQLEXPRESS;
AttachDbFilename=C:\SqlData\Healthdb\Health.mdf;
Integrated Security=True;
User Instance=True"
providerName="System.Data.SqlClient"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top