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

  • Home
  • SEARCH
  • 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 615963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:16:34+00:00 2026-05-13T18:16:34+00:00

I pulled an ASPNETDB.MDF file off of a server for a ASP site using

  • 0

I pulled an ASPNETDB.MDF file off of a server for a ASP site using Forms authentication to my local machine. I added a new user to the database file using the ASP.NET Website Configuration tool. I uploaded the MDF file back to the server and now I get the following exception whenever I try to log in as any user:


Cannot open user default database. Login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

I have been googling and read all of the other solutions to this problem here on SO as well and haven’t found anything that works.

The server has SQL Server 2008 on it and that’s what I am using on my local machine with VS 2008 Professional.

My connection string is (linebreaks added for legibility):

<add name="ASPNETDBConnectionString1" 
     connectionString="Data Source=.\SQLEXPRESS;
                       AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;
                       Integrated Security=True;User Instance=True" 
     providerName="System.Data.SqlClient"
/>

I’m new to SQL Server so I am pretty sure I messed something up somewhere.

Any help is greatly appreciated.

  • 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-13T18:16:34+00:00Added an answer on May 13, 2026 at 6:16 pm

    All questions about who or what or why regarding the config aside…

    Your problem can be deduced from the connection string. That will work locally against sql express but not against sql proper on the server.

    The first clue is that only SqlExpress enables User Instances. On Sql proper you will have to attach the mdf.

    If that connection string works on your machine while in VS 2008, you have SQL EXPRESS installed. If that connection string works on the server then the server has SQL EXPRESS installed.

    If the server does NOT have Sql Express installed and configured to allow user instances, as I would hope it did not, that connection string will result in the login failure exception you are experiencing.

    I also wonder about your copy to/from. Typically access will be denied an active mdf, even for copying.

    Please confirm Sql versions both client and server side and try to find a previous copy of both web.config files to compare connection strings.

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

Sidebar

Related Questions

Having just pulled my hair off because of a difference, I'd like to know
I pulled out an application that I wrote in C++ using the sfml library,
I've pulled the Subversion repository into a local Hg repository while at work. At
My friend just shared me this new application and I pulled it from heroku
UPDATE So totally pulled a tool moment. I really meant by reference versus Out/Ref.
I have a PDF document that needs to be pulled up in the browser,
Howdy, I have a DataRow pulled out of a DataTable from a DataSet. I
We are currently thinking of building a cache-system to hold data pulled out of
I have a JSP which attaches a XSL to an XML document pulled from
In my crystal report, I noticed one of the fields being pulled from a

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.