When you use sqlexpress integrated security sspi attachdbfilename datadirectory aspnetdb.mdf along with user instance true, you might get the error like insert failed, update failed or data retrieval failed for database, because it is being used by another process or the database is read-only. This error shows an annoying error screen with collection of database exceptions along with stack trace.
This error generally occurs when aspnetdb connection remains open especially in IDE of Visual Studio 2005 or Visual Web Developer 2005 Express Edition’s Server Explorer. Coz when you explore the database tables using internal server explorer of visual studio it locks the database and doesn’t allow to update while it’s connection live in server explorer.
So, to troubleshoot this problem, detach the sql database from server explorer before debugging your ASP.Net web application.
See Also...
Error: Aspnetdb.mdf failed a Database with the Same Name Exists
Be the first to rate this post
Tags: asp.net 2.0, aspnetdb, sql server 2005, database, app_data, aspnet_regsql command
7/24/2008 5:22:21 PM