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 6865881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:06:33+00:00 2026-05-27T03:06:33+00:00

I am not sure what’s going on exactly as I can’t establish a strict

  • 0

I am not sure what’s going on exactly as I can’t establish a strict linear correlation between
events. But below you’ll find my connection string, at times it works, other times when I open the app/project I am building (no changes made) it doesn’t and gives me various errors and reasons.

<add name="EFDbContext"
     connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\EFDbContext.mdf;MultipleActiveResultSets=true;Integrated Security=True;User Instance=True"
     providerName="System.Data.SqlClient" />

Errors include:

Unable to complete operation. The supplied SqlConnection does not specify an initial catalog.

or

saying Amin-PC\Admin has no access rights (I am logged in admin)

Also when I try to add a new connection at times it will tell me I have no access rights or database already exists or just adds it normally!

I tried explicitly starting visual studio as administrator and this seemed to help with the denied access to the db issue.

Basically I don’t know what the heck’s going on.

Have recently started with .net and it has been easy coding for asp.net mvc framework until I got to interacting with underlying asp.net infrastructure, connection strings, outdated (noon-entity framework ready) membership provider etc.

And now don’t know what’s going on with the SQL Server Express edition that gets installed a long with VS2010.

  • 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-27T03:06:34+00:00Added an answer on May 27, 2026 at 3:06 am

    My recommendation would be: since you already have a server instance (.\SQLEXPRESS) installed – attach your databases to the SQL Server Express instance, and then use them under their database name (instead of using the shaky AttachDbFileName= method).

    So:

    • launch your SQL Server Management Studio Express
    • find your MDF files you want
    • use Server > Attach Database to attach the MDF/LDF to the server – give it meaningful name
    • from that point on – use the database on the server and don’t attach MDF’s on the fly….

    Your connection string would then look something like:

    server=.\SQLEXPRESS;Database=YourEFDatabaseName;Integrated Security=True
    

    I find this method is typically much more reliable and predictable – the AttachdbFileName= and User Instance=true are supposed to be easier, but tend to be more confusing that anything else….

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

Sidebar

Related Questions

Not sure what exactly is going on here, but seems like in .NET 1.1
Not sure why I can show jpg images in the simulator but not when
Not sure if I can word this right but here we go. I have
Not sure if the title is quite right for the question but I can't
Not sure why i can figure this out but would appreciate some assistance. I
Not sure whats going on here, or what could be the integer in this
Not sure if im just being stupid or something but here goes i work
Not sure how to ask this, but i'll give it a try: I have
Not sure if this is a big deal. But wondering why when the site
not sure what I'm missing here, but i keep getting the error. SQLSTATE[HY093]: Invalid

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.