Search code examples
asp.net-mvcvisual-studiovisual-studio-2008sql-server-2005sql-server-2008-express

Visual Studio 2008 with SQL Server 2005 Developer Edition


I am trying to add a database to the App_Data location in an ASP.NET MVC 2 application in Visual Studio 2008 (VS).

I have SQL Server 2005 Developer Edition installed on the local machine. However when adding the database VS complains that SQL Server 2005 Express is required. I configured VS to use the local server instance (MSSQLSERVER) which is the developer edition. It still failed.

I installed SQL Server 2005 Express on the machine and configured VS to use the Express server instance (SQLEXPRESS) and the database creation started working.

My questions is whether there is a way to get VS to use the developer edition of SQL Server.


Solution

  • Sure you can use the SQL Server 2005 Developer edition - you just cannot add the .mdf to App_data if you do this.

    SQL Server 2005 Express has this extra feature that you can just simply drop a .mdf/.ldf in the App_Data folder and get going. But this is an Express-only feature.

    If you want to use SQL Server 2005 Developer, you need to create a database on the server, using SQL Server Management Studio, and you need to connect to it using a regular connection string. The mdf/ldf files will be placed in the usual SQL Server data directory and used from there.