views:

184

answers:

3

How do I make the SQL Express 2008 the default for VS2008 instead of SQL Express 2005?

A: 

In Visual Studio, go under Tools -->Options -->Database Tools-->Data Connections. There is a field for SQL Server Instance Name.

I'm assuming that is what you mean by Default. Depending on what type of project you area creating, you usually specify the database connection.

Dwight T
It seems that the comment is "leave blank for default instance." Doing so causes an error when I try to add an SQL Server Database to the project the error message starts "Connections to SQl Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verirfy..." I get the same error when I use a named instance of SQL Server 2008 on my machine.
+1  A: 

If you're adding MDF's to your web site folder, I think you're using a feature called User Instances. That's hardly advisable, and it's being depracated:

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

Instead of using user instances, use Server Explorer to connect to Sql Server Express, and create a database from there.

Andomar
Thanks- I didn't know this was upcoming...
A: 

Are you running Visual Studio 2008 SP1? I think that may be required for SQL Server 2008 support.

Otherwise, please say why you believe 2008 is not the default. Are you receiving an exception or error message? Is there something that's not working?

John Saunders
I am running VS2008 SP1. When I try to add an SQL Server Database to the project the error message starts "Connections to SQl Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verirfy..."
Please give the precise command sequence you are using. "When I try to add ... to the project" is ambiguous. Also, as a diagnostic, try to use "Add New Item", "DataSet", and open SQL Server 2008 in Server Explorer, and drag a table onto the design surface. Report if that works, or how it fails.
John Saunders
Right click on App_Data --> Add new Item --> SQL Database --> accept default --> OK gives "Failed to generate a user instanct of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. The diagnostic you suggested seemed to work for my instance of SQL Server 2008 (not SQL Express 2008)
What was it about this message that suggests that there's a different default? It's trying to start a user instance, and that's not working. That's a different problem.
John Saunders