locked
Cannot create a new SQL Server 2008 database in Visual Studio 2008 RRS feed

  • Question

  • I am working on Windows VISTA (x64) Ultimate SP2, with Visual Studio 2008 SP1 and I also have SQL Server (Express) 2008 installed. I recently upgraded from SQL Server Express 2005 to SQL Server 2008. This also required that I upgrade to IIS7, and so I did.

    When I try to work with my database files in the SQL Server 2008 Management Studio I have no problem at all. I can see and alter all tables, stored procedures etc., and edit any of them as desired, again without issues.

    In Visual Studio 2008 however, I cannot create new database files. Here is what I am trying:

    1. I right-click on my web site's App_Data folder, and choose "Add New Item...",

    2. I select Sql Server Database from the Visual Studio dialog.

    3. I click OK, but I get the following error message:

    "Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component or download from the URL: ..."

    In addition to the above, when I run my ASP.NET 3.5 web app on the localhost, and it tries to add a record to my database file, I get this error:

    "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed ."

    and the app fails.

    Here is what I've tried thus far:

    1. I have tried to go to the Query Window in SQL Server 2008 Management Studio and ran this command to make sure user instances were enabled:

    exec sp_configure 'user instances enabled', 1.
    Go
    Reconfigure

    After running this query and I stopped and then restarted SQL Server service.

    2. I have gone to delete the .../SQLEXPRESS folder which is recommended in many of the solutions that I've read.

    3. I have assigned full permissions for SqlServer.exe to my user which in my case is

          SQLServerMSSQLUser$George-PC$SQLEXPRESS

    So as you can see I've tried some of the solutions displayed online, but nothing seems to be working for me. I would really appreciate it very much if anyone could please help me to find a solution to this problem. I've been on it for days but I am just not getting anywhere.

    Thanks for your help in advance.

    Thursday, October 22, 2009 12:57 AM

Answers