views:

421

answers:

2

Is it possible to use the App_Data folder in conjunction with SQL Server 2005?

When I try it specifies Express even though I have changed the Tools>Options>Database>Data Connections to the correct server. I have downloaded SQLEXPR32_x86_ENU.exe Version 10.0.1600.22 file locally and have gone through 7 installs and deinstalls with a variety of different errors. I pretty much given up on Express and would like to find a workaround if it exists.

Thanks

Dennis Keith

A: 
Richard
Thanks for your response Richard. With a huge AhHa I ran to machine.config only to find:<add name="LocalSqlServer" connectionString="Data Source=DENNIS\DENNIS2005;Initial Catalog=aspnetdb;Integrated Security=True" /> This string works in a Data Connection made under the Server Explorer. There are no entries in the web.config and there is no mention of Express in the machine.config.Puzzled
Dennis Keith
As per ususal, I should add something. The error comes up when I try to add a new mdf data file to the App_Data folder. When I try to open an existing database there's no problem.
Dennis Keith
And the error reads "Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify ...."
Dennis Keith
I've expanded the answer. I think you are still mixing up SQL Express and SQL Server: choose one and configure consistently for that choice.
Richard
A: 

Putting a *.mdf file into your App_Data and attaching it as a user instance database works only with SQL Server Express, yes.

If you want to use "real" SQL Server, you can still put your *.mdf and *.ldf files into App_Data - you just can't automagically attach them to your SQL Server instance, you'll have to do this manually using SQL Server Management Studio (in the Object Explorer of your SSMS, go to the "Databases" node and right-click, pick "Attach...." and then navigate to your App_Data folder and pick the *.mdf file).

So yes, in a way, Visual Studio has a App_Data folder that makes most sense with SQL Server Express (which is being installed with Visual Studio by default).

Marc

marc_s