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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:40:55+00:00 2026-06-14T09:40:55+00:00

Using VS 2010, MVC 3, and SQL Express, I’ve been following the tutorials on

  • 0

Using VS 2010, MVC 3, and SQL Express, I’ve been following the tutorials on ASP.net. I’m also using EF code first. So far, my connection string has been:

<add name="MusicStoreEntities"
     connectionString="Server=.\SQLExpress;Database=MusicStoreDB;Integrated Security=SSPI;User Instance=true"
providerName="System.Data.SqlClient" />

Which creates the db in:

C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS

I now want to have the database reside in the App_Data folder. So I created a new web application following a different tutorial, but this time I added a SQL database to it, and modified the connection string for the membership database by changing the database name. I then used aspnet_regsql.exe to create the membership tables. I then created POCO classes, a controller and added seed data. Since the database already existed, it complained about not having an EdmMetadata table. Upon researching that I realized my mistake and deleted the database. Not to mention the DB will be dropped and created as the project is modified. Running the project again gave me the error “Initial catalog not specified” so I modified the connection string. Running the project again I get the error ‘C:\ContosoUniversity\ContosoUniversity\App_Data\School.mdf’ already exists. Choose a different database name.

A search of my hard drive reveals this database does not exist. My connection string looks like this:

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

What is making it think the DB exists? What do I need to do to get code first to create the DB in the App_Data folder?

  • 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-14T09:40:56+00:00Added an answer on June 14, 2026 at 9:40 am

    Although I ended up changing the database name in frustration, a search of my registry revealed multiple entries for school.mdf in the app_data directory. Removing these solved the problem.

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

Sidebar

Related Questions

I have an ASP.NET MVC 3 application using an Entity Framework (4.3.1) Code First
I am using Visual Studio 2010, ASP.NET MVC 3, with a SQL 2008 R2
We have a wonderful ASP.NET MVC 2 web application using MS SQL 2008 and
I am implementing a SaaS application using ASP.Net MVC 2 and SQL Server database.
I've been using the entities framework with ASP.NET MVC and I'm looking for an
I'm running ASP.NET MVC 2 Preview 2 (With VS 2010 Beta 2) using Entity
Using VS 2010 beta 2, ASP.NET MVC. I tried to create an Entity framework
I am using VS 2010, MVC 3.0, SQL Server Standard edition (not Express). I
I am using Visual Studio 2010 / ASP.net MVC 3 with the Razor View
I have created an asp.net MVC application in VS 2010, and am using TFS.

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.