简体   繁体   中英

sql server and file monitoring

i have a problem with a sql database. if i open it in smo then i can't access it in vs.net because i get the famous error "another process using this file" so before i could open it in visual studio i have to detach it from smo database list.

here is my question, how sql can monitor the mdf file if i keep it detached from its database list? i mean it should somehow monitor the database file to be able to use the automated periodic tasks that has been set by db administrator right?

I think your real problem is in how you're opening the database in Visual Studio. You need the database server to be attached to the file to continue running the jobs. Visual Studio is able to connect to the database server instead of opening the database file . Try viewing the "Server Explorer" window and add a connection there.

Edit :

Since your question is tagged with "asp.net," I take it that you're not talking about Visual Studio opening the file, but rather about your ASP.NET code opening the file. My answer there is similar: use a connection string in your web.config that specifies a connection to your server instead of a connection to the file. http://connectionstrings.com/ can help you figure out what your connection string should look like.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM