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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:44:11+00:00 2026-06-09T11:44:11+00:00

Everything works just fine with the following connection string. <add name=ApplicationServices connectionString=data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User

  • 0

Everything works just fine with the following connection string.

<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

I recently installed SQL Server 2012 Express on my local machine to test with, but I cannot make the connection. Here is my connection string using Windows Authentication.

<add name="ApplicationServices" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=testdb;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />

I’m a total noob who tried his best to search the forums, but am unable to defer my solution from the ‘Questions with similar titles’ section. 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-06-09T11:44:12+00:00Added an answer on June 9, 2026 at 11:44 am

    EntityFramework code first uses a defaultConnectionFactory in the app.config or the web.config file which will automatically connect to .\SQLEXPRESS. This configuration looks like this:

    <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
      </entityFramework>
    

    If you’re using EF Code First, you probably have a class derived from DbContext to use as context. By design, EntityFramework will look for a connection string having the same name as your context class and use that one instead of the defaultConnectionFactory. This is how I’m using it:

    <connectionStrings>
        <add name="ObjectContext" 
             connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=My.Db.Name; Integrated Security=True; MultipleActiveResultSets=True"
             providerName="System.Data.SqlClient"/>
      </connectionStrings>
    

    What I’m suggesting is to check that EF doesn’t use it’s defaultConnectionFactory and even force overriding that by adding the connection string named after your context.
    You should also check this blog article which gives great details about the EF configuration file.

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

Sidebar

Related Questions

I'm doing a 2D game on android, and everything works just fine. The problem
I'm using ABPeoplePickerNavigationController to let the user select an address. Everything works just fine
its really frustrated me over 3days, I've check everything and it works just fine.
I have just added a product and everything works fine. The product is a
I just launched my first MVC3 application and everything works fine except cookies authorisation.
I got a problem with the URLs in TinyMCE. Everything works just fine until
I'm following this tutorial on WCF and everything works fine. Seems like with that
I'm using Code First. Everything works just fine (inserts, updates, selects) everything is tested.
I just did a fresh install of Apache server 2.2. Everything works. When I
Everything works fine locally when I do as follows: cat input | python mapper.py

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.