Last post Jan 17, 2007 05:19 PM by binLaden
Jan 17, 2007 09:06 AM|binLaden|LINK
I have a personal web site that works fine,on my local SQL Express 2005 and my remote SQL Server.
I then moved my project from one disk drive to another as it was taking up a lot of room. This required me to edit my 'project.sln' file so that Visual Studio would be able to find my project. This all worked fine and I can edit, compile, etc.
I then editied my 'web.config' file to update the path to my local database file. However, when I try to connect I get an error saying that my database exists at the old path and so cannot connect along the new path. Thats silly, because the old path (and
its ancient 8gb harddrive) are in the dustbin.
Of course I can connect as before to my remote server.
Where is my project remembering that old information from?
Here is the error message. You can see that I moved things from I: to D: -
Database 'I:\Work\SOFTWARE_DEVELOPMENT\WebDev\Navisan\Blog\App_Data\ASPNETDB.MDF' already exists. ( <--a lie )
Could not attach file 'D:\Work\SOFTWARE_DEVELOPMENT\WebDev\Navisan\Blog\App_Data\ASPNETDB.MDF' as database 'ASPNETDB'.
I've even been through the registry on this one. Thanks for any help.
Jan 17, 2007 05:19 PM|binLaden|LINK
I figured it out when I got back from class. What a pain.
Anyway, the only thing I could do was rename the .MDF files from inside Visual Studio because it seemed that ASP .NET was keeping some kind of database name : path mapping information around. You might have to also blow away the relevant log files & let
the new ones be auto-created.
Also in the tool I updated the .MDF path information (of course, but that didn't make any difference before deciding to rename them). I then updated the 'web.config' connection strings to point to my new database names. No application code at all had to
change, so I dodged this bullet:)
-yoshiro (mark) aoki
UNC, Chapel Hill NC wishing I was at Whistler, BC Canada :)