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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:00:41+00:00 2026-05-29T04:00:41+00:00

I have an error below adding an .mdf file (SQL Server Database) in a

  • 0

I have an error below adding an .mdf file (SQL Server Database) in a Visual Studio 2010 project

Connections to SQL Server database files (.mdf) require SQL Server
2005 Express or SQL Server 2008 Express to be installed and running on
the local computer

I don’t want to install SQL Server Express (2005/2008) because I have already installed
SQL Server 2005 Enterprise Edition

I am using Visual Studio 2010 Ultimate

  • 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-29T04:00:42+00:00Added an answer on May 29, 2026 at 4:00 am

    This is a really annoying one. Basically, in Machine.config for the version of the framework you are developing against, there is an entry for LocalSqlServer.

    On my machine, for version 4:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\Machine.config

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

    I found that if I changed the data source part of the connection string to point at my Sql 2005 full server instance, then the error you mentioned went away.

    (Similar for other versions of the framework, which I also changed)

    I can’t remember if I needed to restart just visual studio or the whole machine before I saw the changes work.

    Remember to back up your machine.config files before editing them!

    With that being said, there’s also no reason why you can’t add the database into Sql Server itself (if you have the mdf) then connect to it from Visual Studio via the View -> Server Explorer -> Data Connections (Right Click -> Add Connection) – have you tried that?

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

Sidebar

Related Questions

I have developed a WCF service and, while in Visual Studio 2010, I can
I have ported our project from Delphi 7 to Delphi 2010. After adding some
I have this strange error in SQL Server 2005 where I take a working
I have a website that I get the below error on whenever I navigate
I get this error, while I'm testing the code below: You have an error
I have a user who randomly gets a Script Error box (shown below) which
I get the following error in the query below: #1064 - You have an
I am getting JQUERY undefined error. Do you have any idea (code below). <%@
I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx
Edit: This was user error (sorry). I have answered it below. I am developing

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.