Bo Chen – MSFT:
Hi TheEagle ,
Is your applicatoin(web site) still running? Note that sql express use UserInstance which means when your application is running, the database would be auto-attached to sqlexpress instance and when your application ends up, that database would be auto-detached from sqlexpress. So,even if you have elaborately detached that db from sql express, after you run your application again, and during your application runtime, that db(mdf file) is still attached. Based on my understanding, I think if you try to attach a databse to sqlexrpess which has already been attached, you would get the error message that you are getting now.
Hope my suggestion helps
Thank you for responding to me.I have detached that database in the Management studio express.A three options page appeared(keep,drop,..) I leave it as default which was keep then the database disappeared in Management studio express then I set the connection as the following:
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=D:\..\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
Then I run the application and the error prevent the application from strating.
Hope that you can help me as fast as possible.