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.

Please tell me why I am having this error? I have a SqlDataSource and I have set my connection string as well properly.. I am fairly new to ASP.NET so please give me suggestions on how to fix this...
kuntilanakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VenkatgviCommented:
a. Open the VS Project for which you need to connect to a SQL database
2) Goto control panel> Admin tools> services
3) Look for SQL Server (SQLEXPRESS) service and Stop it and start it again
4) Try connecting your database now.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
masterpassCommented:
The Error says it all .... The file you are trying to open is locked by some other process which is preventing the access ... Can you tell which file you are trying to access ?
0
masterpassCommented:
If you are using Visual Studio and if the connection to the local DB in Server Explorer is open, just close it and the page will be rendered.  After that Right click on the connection in Server Explorer, and chose "Close Connection"
I think that will solve the issue
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Mike_MozhaevCommented:
Use Process Explorer utility from SysInternals suite to find out who holds the file.
Just press Ctrl+F, type part of filename and press Search

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
0
kuntilanakAuthor Commented:
>>a. Open the VS Project for which you need to connect to a SQL database
>>2) Goto control panel> Admin tools> services
>>3) Look for SQL Server (SQLEXPRESS) service and Stop it and start it again
>>4) Try connecting your database now.

where is the control panel?

I tried to start and stop the SQLEXPRESS via SQL Server Config Manager however it still gives me the same result
0
masterpassCommented:
reposting  ...........

If you are using Visual Studio and if the connection to the local DB in Server Explorer is open, just close it and the page will be rendered.  After that Right click on the connection in Server Explorer, and chose "Close Connection"
I think that will solve the issue
0
kuntilanakAuthor Commented:
please clarify what you mean by the connection to the local DB in Server Explorer.. are you referring to the .mdf?
0
masterpassCommented:
Yes, The VS has a server explorer which will list the connection to the DB. The MDF file is what I am talking about
0
kuntilanakAuthor Commented:
well if I close the connection then it won't be able to pull out data from the server right
0
VenkatgviCommented:
control panel i meant is windows control panel

click the start button in windows - settings - control panel
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.