Error from VS2008, requiring SQL Server 2005, refuses to acknowledge SQL 2008

Posted on 2009-04-26
Last Modified: 2013-11-26

I'm using Visual Studio 2008 SP1, trying to create a Web Project. When I attempt to add a new SQL database (an 'mdf' file), I get the message "Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly."

I have SQL Server 2008 installed. I have  set my instance in Tools->Options->Database Tools->Data Connections->SQL Server Instance Name to point to 'newdell1\sqlserver2008'.

I have been all over the web and MSDN to try to find a solution, but I can't seem to find one.

The Server Explorer in VS2008 allows me to work directly with SQL Server 2008. I just can't get the Sql Server database file template to create a SQL Server 2008 mdf.
Question by:Spotzo
    LVL 26

    Expert Comment

    by:Anurag Thakur
    Please check the version of the newly created SQL Server database files.

    Attach the database files in SQL Server Management Studio, right-click the database name, choose Properties, then check Compatibility level in the Options tab.

    If the Compatibility level of the newly created database files is "SQL Server 2005 (90)", I think maybe there are both SQL Server 2005 Express and SQL Server 2008 Express on your machine.

    If so, please try to modify the SQL Server Instance Name in Visual Studio 2008.
    Go to Tools -> Options -> Database Tools -> Database Connections, fill the SQL Server Instance Name with the name of SQL Server 2008 Express instance. Then create a new database in Visual Studio 2008 and check its version to confirm.

    Author Comment

    ragi0017- That is a direct cut-n-paste from MS ASP.NET forums, from some guy named Jian Kang at Microsoft. It doesn't solve the problem.
    LVL 26

    Expert Comment

    by:Anurag Thakur
    i know its a copy and paste
    have you installed sql management studio to connect to your sql express databases.
    have you got 2 versions of sql express - 2005 & 2008?

    Accepted Solution

    "i know its a copy and paste
    have you installed sql management studio to connect to your sql express databases.
    have you got 2 versions of sql express - 2005 & 2008?"

    I do not have SQL Express 2005 installed; I have SQL 2000 (MSDE) on my machine, but it's not running. The only active database engine that's active is 2008.

    Yes, I have SSMS installed, and it works fine. I am able to read and write databases under SS2008.  I can also access them problematically with ADO through VB.NET. I can even see and manipulate SS2208 databases in the Server Explorer portion of Visual Studio 2008.

    The problem appears when I try to add a new SQL Server database to a web project from the "Add New Item" menu. That is when VS complains that using an .MDF file requires SSE 2005.


    I don't know for sure which directory it was, but one of the changes I made seems to have solved my problem.

    It seems to be related to deletion of directories under "'C:\Documents and Settings\Default\Local Settings\Application Data\Microsoft\". I deleted some existing SQL directories, which forced them to be recreated.  

    I wish I could say which directories did the trick for me. I can say the two directories that show today's date in the "Date Created" column are "C:\Documents and Settings\Default\Local Settings\Application Data\Microsoft\Microsoft SQL Server"  and "C:\Documents and Settings\Default\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data" .

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now