Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3270930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:40:59+00:00 2026-05-17T18:40:59+00:00

I have an ASP.NET 3.5 app with a SQL 2005 Express .mdf database file

  • 0

I have an ASP.NET 3.5 app with a SQL 2005 Express .mdf database file in its App_Data folder. Lets call that Foo.mdf. On its own the ASP.NET app can connect to the database with no problems. So far so good.

Then, if I install Sql Server Management Studio Express on the server and start it, it finds the local SQLEXPRESS instance and connects to it, but doesn’t show Foo.mdf in the list of databases.

So I try and Attach Foo.mdf by right-clicking on databases and selecting Attach.. and finding the .MDF. This fails with a vague error:

CREATE FILE encountered operating system error 32(error not found)  
while attempting to open or create the physical file
'C:\inetpub\wwwroot\FooApp\App_Data\Foo.mdf'. (Microsoft SQL Server, Error: 5123)

If I stop my ASP.NET site in IIS, then the attach does work, but then when I restart my ASP.NET app, it can’t connect to Foo.mdf.

So it looks like SQL Express 2005 will only let either my app or Management Studio connect. This seems really crap – surely Sql Express should allow more than one connection? I was expecting it to behave like regular Sql Server.

Hopefully I’m doing it wrong. Please advise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:40:59+00:00Added an answer on May 17, 2026 at 6:40 pm

    Can you check your application connection string and see if it has User Instance=true

    eg :

    Data Source=.\SQLEXPRESS;Integrated Security=true; AttachDbFilename=|DataDirectory|\mydb.mdf;User Instance=true;
    

    From MSDN : The other main issue with user instances occurs because SQL Server opens database files with exclusive access. This is necessary because SQL Server manages the locking of the database data in its memory. Thus, if more than one SQL Server instance has the same file open, there is the potential for data corruption. If two different user instances use the same database file, one instance must close the file before the other instance can open it.

    If that is the issue, then you can attach the database in SQL Server Management Studio and modify the connection strings as follows so that multiple clients can connect to the same database.

    Server=.\SQLEXPRESS;Database=myDataBase;Trusted_Connection=True;
    

    If this isnt the issue in your case, also check out the “Common Issues” section at the link above. It could be related to permissions as per points 1 / 2 in the “Common Issues” section

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET app that uses a SQL Server database. I now need
I have a Web application made in ASP.NET and MS SQL 2005 as database
Currently my app pulls data from an Microsoft SQL 2005 database via ASP.NET XML
General Info: ASP.NET MVC app using ADO.NET Entity Framework SQL Server 2005 I have
I have an ASP .NET 2.0 website connected to a SQL Server 2005 database.
I am developing ASP.NET 2.0 application using SQL Express 2005. I have attached my
I have a database running on MS SQL Server 2005 and an ASP.NET 3.5
I have an asp.net web app which holds its data in an sql server
I have an C# asp.net app using the default Sql MembershipProvider. My web.config has
I have a SQL query in my ASP.net web app that looks like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.