News:

SMF - Just Installed!

Main Menu

Unable to connect to MSSQL using web.config

Started by Suhitha, Aug 09, 2025, 06:17 AM

Previous topic - Next topic

Suhitha

Question: Unable to connect to MSSQL using web.config: Cannot open database "ASPState" requested by the login. The login failed.

Applicable to:

  • Plesk for Windows[/li]


Symptoms

  • Configuring a connection to MSSQL in web.config produces the following error:
Server Error in '/' Application.
Cannot open database "ASPState" requested by the login. The login failed.
Login failed for user 'dbuser'.
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 database "ASPState" requested by the login. The login failed.
Login failed for user 'dbuser'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException (0x80131904): Cannot open database "ASPState" requested by the login. The login failed.
Login failed for user 'dbuser'.]

  • Resolution
  • Connect to the Plesk server via RDP.
  • On the IIS Manager, go to Sites > domain.com > Session State
  • On the Session State screen, under the Session State Mode Settings, I selected 'In process' (see the arrow):
  • On the right, under the Actions pane, click Apply.
  • Open a command prompt as Administrator and run the following command:
    c:/> iisreset