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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:44:24+00:00 2026-06-03T15:44:24+00:00

I have put together a simple ASP.NET MVC 3 test web app that uses

  • 0

I have put together a simple ASP.NET MVC 3 test web app that uses Entity Framework 4.1. My DBContext looks like this:

public class EFDbContext : DbContext
{
    public DbSet<TestParent> TestParents { get; set; }
    public DbSet<TestChild> TestChildren { get; set; }
}

So I am expecting EF will look for a connection string named EFDbContext. Here is what the web.config contains in my local environment:

<connectionStrings>
  <add name="EFDbContext"
     connectionString="data source=.\SQLEXPRESS;Initial Catalog=testDB;Integrated Security=SSPI;MultipleActiveResultSets=True"
     providerName="System.Data.SqlClient" />
</connectionStrings>

I have provided neither a user name nor a password in the connection string. So to my understanding EF will use Windows Authentication for the database connect. In my local environment everything works as expected.

Now – when I release this web app to the server at my web hoster I have to switch to SQL Server Authentication (limitation of the web hoster – fair enough). So I have adjusted my connection string to look like this:

<connectionStrings>
  <remove name="LocalSqlServer" />
  <add name="EFDbContext"
       connectionString="Data Source = localhost\SQLEXPRESS; Initial Catalog = testDB; User Id = dbUser; Password = dbPassword; Integrated Security = SSPI; MultipleActiveResultSets = True; Persist Security Info=True"
       providerName="System.Data.SqlClient" />
</connectionStrings>

That is the only change that I have consciously made. Unfortunately this doesn’t work any more. The error message that is displayed indicates that the database connect is attempted using Windows Authentication and not SQL Server Authentication as I would expect (error message is in German but it lists the user which the hoster has confirmed is one of the Windows users they have created).

The error message also contains the database name as I have specified it in the Initial Catalog part of the connection string. This seems to me like a clear indication that the connection string named EFDbContext is indeed read and used by EF.

My problem is that I can’t even find a starting point to get closer to the problem. The whole thing seems like a black box to me. Does EF attempt SQL Server Authentication and then switches to Windows Authentication as a fallback? Or do I need to change a setting in some config file to force EF over to SQL Server Authentication?

I couldn’t come up with any sensible way to scale my application back further. My Google searches didn’t get me anywhere, and banging my head against the wall multiple times didn’t deliver a solution either. So any help would be much 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-03T15:44:26+00:00Added an answer on June 3, 2026 at 3:44 pm

    Why did you keep the “Integrated Security = SSPI; ” in you connection string? See here for getting more info on connection strings.

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

Sidebar

Related Questions

I have put together a small ASP.NET MVC 2 site that does some very
Hi guys I have put together a simple dropdown menu system that uses hoverIntent
Trying to do a simple web app with jquery mobile. I have put together
We've put together an app that is mostly working in phonegap. We have an
I have a asp.net app that I want to disable the buttons as soon
I have a ASP.Net web form that contains both text box fields and hidden
I have MANY small Test Projects where I put together just enough code to
I'm trying to put together a form_tag that edits several Shift objects. I have
I put together a simple script that pulls the product name, category name and
I put together a simple system so that my dad can manage a website

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.