The problem is... I open the webpage directly in VS2008 and can connect to the database... but by entering the address, you can also open the webpage, but there is a problem with the database...
The requested Database "TakeClass" cannot be opened ". Logon Failed.
User '2d2727e2578f446aspnet' Login Failed.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details: System. Data. SqlClient. SqlException: the requested Database "TakeClass" cannot be opened ". Logon Failed.
User '2d2727e2578f446aspnet' Login Failed.
I have encountered this problem before. After searching, follow these steps to solve it.
1. Open the Database Enterprise Manager, and then select database --- security --- find the ''xxxaspnet'' that reported the error. -- Right-click "attribute ";
2. Select the "user ing" option-select the database to be accessed
3. Do not click "OK". Select the database we just selected and select the "db_owner" permission in the "database role member identity" section below.