God damned SQL Server
This almost drive me nuts !
God damned SQL Express cannot attach my mdf file!
What I want is only to rename default database name created by Visual Studio from aspnet-WebApplication2-20140601123335.mdf to IdentityContext.mdf. I already change the logical filename via SSMS and successfully attached it.
But when it being attach when my web application runs, it just failed :
Database aspnet-WebApplication2-20140601123335.mdf' already exists. Choose a different database name. Cannot attach the file IdentityCotext.mdf' as database 'IdentityContext'.
I'm sure I have cleared all occurrence of aspnet-WebApplication2-20140601123335 but that god damned SQL keep recognizing it. From where ?
Frustrated, I restart my computer as my last hope that it will be resolved.
Irritating !! unacceptable !! the problem persists. How the hell ?!
~~~
OK, now, after I banged my head to wall and got some enlightenment. The problem is related to User Instance=true in my connection string. This caused my database attached to invisible instance. So in that invisible instance, I don't know how, aspnet-WebApplication2-20140601123335.mdf is STUCK there.
How the hell I get it remove if I cannot connect to that invisible instance ?
here is the answer.
Then after successfully connected to that instance I drop that god damned database and it works now !
There it goes, wasted my precious 3 hours for this silly rename problem, grrrr
( ` ')=333#


















