IIS7 on Vista and SQLExpress problem

G

Guest

Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It uses an sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my Vista machine and created a new website, point at the website's directory. After I switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

"An attempt to attach an auto-named database for file ...\thepoint.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

The file in question exists, and the whole website directory has Everyone Full Control permissions, with permission inheritance on, so that should be fine.

The Visual Studio isntance of this isnt running (im not running visual studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in App_Data - in fact, the database works fine when I run it through VS/Dev Server for debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User Instance=True.

Any help much appreciated.

Thanks

Dan
 
G

Guest

I believe this is because the auto-attach feature of SQLEXPRESS only works for local connections. You will probably need to permanently attach the MDF database file using the SQLExpress Manager or the appropriate T-SQL Command.
Peter
 

Steven Cheng MSFT

Usenet Archive
Joined
Dec 23, 2003
Messages
6,562
Reaction score
0
Thanks for Peter's input.

Hi Dan,

My understanding is after you create new website virtual dir on the Vista IIS7 box, it still point to the web application directory on original development machine, through a UNC share. Is this your case?

If so, the error may be caused by the SQL Express database file is on remote location. I suggest you perform the following test:

** copy the entire website to a local physical directory on the vista box and configure IIS to use the local locaiton to test

** Or as Peter suggested, you can consider directly attach the database file to the SQL Express instance on VISTA and let your asp.net application (modify connectionstring) connect that attached database to see whether it works.

If there is any other finding, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

Hi Steven,

Unfortunately, there is no UNC share involved - that's why I don't understand it too well. VS, the website, the mdf, IIS7, firefox... all on the
C: drive of my laptop (Vista Ultimate).

Peter's suggestion sounds like it would break the SQL database in Visual Studio? I still want to be able to run the site from VS as well for debugging purposes.

Is it possible to make all this work, all I wanted to do was test my site in
IE6 :(
 

Steven Cheng MSFT

Usenet Archive
Joined
Dec 23, 2003
Messages
6,562
Reaction score
0
Thanks for your reply Dan,

Don't worry, we can try locating the problem step by step. I suggest you try make the SQL Express database attached into the SQLExpress instance or any other instance temporarly for test to see whether it works. If it works, we can make sure that the problem just focus on the database connection's establishment.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Steven Cheng MSFT

Usenet Archive
Joined
Dec 23, 2003
Messages
6,562
Reaction score
0
Hi Dan,

Any progress on this issue? Please feel free to post here if you need any help on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.
Subject: RE: IIS7 on Vista and SQLExpress problem
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,245
Members
248,133
Latest member
DujonT

Latest Threads

Top