I have an ASP.NET web application build using VWD 2008 and using SQL Server Express. When I start my application from within VWD 2008 (i.e., using the ASP.NET development server), it works fine. However, when I close VWD 2008 and try to load the application using IIS 5.1, it fails with this error:
An attempt to attach an auto-named database for file failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Here is my connection string:
<add name="Version013ConnectionString"
connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename="C:\MyFilepath\App Name\App_Data\Version013a.mdf"
Integrated Security=True;Connect Timeout=30;
User Instance=True" providerName="System.Data.SqlClient"/>
I'm aware that this issue crops up quite regularly on the forums - I've spent quite a while reading them and trying different ideas, with no success.
As I say, I don't understand why it works under ASP.NET dev server but not under IIS. My guess is there's some sort of permissions issue, but that's just a guess and I'm open to any suggestions.
TIA,
Paul