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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:08:18+00:00 2026-05-31T13:08:18+00:00

I am writing an ASP MVC 3 application. I am using Sql Server 2008

  • 0

I am writing an ASP MVC 3 application. I am using Sql Server 2008 R2 for my database.

I created my data model and my DbContext called EFDbContext.
I created my database which is named SportsStore.

My connection string is:

<add name="EFDbContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=SportsStore;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient" />

I run the app and no data is shown.

I figured out that EF automatically generates a new database SportsStore.Domain.Concrete.EFDbContext, but I want it to use SportsStore which I have previously created, and to automatically map my model properties to table columns.
If I disable the autogenerate database feature I get the following error:

Cannot open database “SportsStore.Domain.Concrete.EFDbContext”
requested by the login

Shouldn’t Entity Framework try to open SportsStore database? Why is it trying to open that one? Do I have a mistaken connection string?

  • 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-31T13:08:19+00:00Added an answer on May 31, 2026 at 1:08 pm

    hmm.I was getting same error.after some effort i realized that i had put connection string in wrong Web.config file.There are two web config files.One under view folder and another under the project.You need to add connection string in one under the project folder

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

Sidebar

Related Questions

I am writing and ASP.NET MVC application with SQL Server 2008. Unfortunately, the only
I'm writing an ASP.Net MVC application using Jquery to post some data to my
I am writing web application using ASP.NET MVC + NHibernate + Postres stack. I
I'm writing an ASP.NET MVC application using NHibernate as my ORM. I'm struggling a
Introduction I'm writing a web application (C#/ASP.NET MVC 3, .NET Framework 4, MS SQL
When writing my first asp.net MVC application using C#, I see that there are
I'm writing an ASP.NET MVC application and trying to use a RESX file to
I am writing an ASP.Net MVC application that uses NTLM authentication, so users don't
We are writing an ASP.NET MVC application. By default, if the client browser has
I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually

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.