• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3505
  • Last Modified:

Unable to open the physical file "". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".

I have a .mdf file in App_Data folder. When I am trying to run the program from my server, I am getting this error:

Unable to open the physical file "". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".

This is my web.config connection:
<add name="hometourConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\hometour.mdf;Integrated Security=True;User Instance=True"
   providerName="System.Data.SqlClient" />

How do I fix it?
0
siddhuoops
Asked:
siddhuoops
  • 2
  • 2
1 Solution
 
REA_ANDREWCommented:
how do you access it are you going through a typed dataset?

Andrew
0
 
siddhuoopsAuthor Commented:
I am using the objectdataSource and yeah I am using a dataset to access it.
0
 
surajgupthaCommented:
Do you know if the same MDF is being used by some other application/ service?
Are you getting this error when you launch the IE through the IDE through the inbuilt web server?
If you are using VS2005 and you have deployed it to IIS, try closing your IDE and then try accessing it.
0
 
surajgupthaCommented:
After every use, are you closing the Connection?
0
 
siddhuoopsAuthor Commented:
yeah did that...got it fixed. I closed the IDE and opened the site in my server. This time it worked. So, everytime, I do this, do I always have to close IDE?
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now