question:
Having the same problem and have spent 2 frustrating days trying to figure it out. Project runs from within VS.net OK -- because VS is authenticating as [machine]/ASPNET -- but if I try to run as http://localhost/[application] I just get the "Cannot open user default database..." error. I've created a [machine]/ASPNET user account in SQL Server Express, assigned it to sysadmin role, have set SQL Express to run in mixed-mode, but all to no avail.
the way to fix:
I had the same use and tried a whole bunch of things, but this is what solved it for me:
- it seems I had the DB still opened inside my IDE (Visual Web Developer Express), in the database explorer. Right-clicking the database and selecting "close connection" fixed it.
Hope this helps.
本文解决了ASP.NET应用程序中遇到的一个常见问题:当尝试从浏览器运行应用程序时出现“无法打开默认数据库”的错误。作者发现问题是由于数据库连接在IDE中未被正确关闭导致,并给出了具体的解决步骤。
1万+

被折叠的 条评论
为什么被折叠?



