LA.NET [EN]

Dec 05

Today I’ve ended up getting the following error after refreshing a page that was working (3 minutes before):

Server Error in ”/” Application.

Cannot open user default database. Login failed.
Login failed for user ”IIS APPPOOLASP.NET v4.0”.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user ”IIS APPPOOLASP.NET v4.0”.

As I said, this happened while I was updating the code for my book and it happened when I hit refresh on a working page in the browser. So, if it was working just a few minutes ago, why did it stopped working? It must have been something I’ve done, but what? After some seconds, I’ve remembered that I did add a new LINQ To SQL file to my project and that it used the same SQL Express database (user instance) than the remaining site. After checking the Server Explorer, I could see that VS was still connected to the instance database. And yes, that was the problem: closing the connection on Server Explorer made the error go away!

I’m almost positive that this was not the error one got in previous versions of ASP.NET (when an user instance was opened by some other process), but I might be wrong. Now, the important thing is that if you end up getting this error, you should check if there’s anything holding up your user instance db file. And that’s it. Stay tuned for more.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>