I've had a site up and running for quite some time with "ASPNETDB.MDF" as database. I recently got a request to make a second site with it's own database, but that also includes a admin interface to manage the first site's database.
"Fine", I thought. "I'll just add a new connection string and point to the first database.". But unfortunately it seems to involve a few more steps then that.
My connection strings are:
<add name="ASPNETDBConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
<add name="myfirstsite_ASPNETDBConnectionString" connectionString="Database=myfirstsite_aspnetdb;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\\Inetpub\\myfirstsite\\App_Data\\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
But whenever I start up my first website I can't access the database through my second one. I just keep receiving the error:
"Cannot open user default database. Login failed.
Login failed for user
View Complete Post