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 a multi-user ASP.NET app running against SQL Server and want to have
I have a SQL Server 2000, C# & ASP.net web app. We want to
I have an asp.net app and I am trying to save a text file
I have an ASP.NET app running in IIS that is hosting files all great
I have a main asp.net app, which is written in asp.net 1.1. Runnning underneath
I have an asp.net mvc app running on a local iis website that is
Assume I have an ASP.NET MVC app that's not doing anything too fancy (no
I have a ASP.net 2.0 app and I have made some changes the the
I have an asp.net update web app. Users go the the page, hit the
We have CC.NET setup on our ASP.NET app. When we build the project, the

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.