Cannot open database requested in login 'ASPState'. Login fails. Login failed for user 'sa'.
From: Greg Dunn (MyLists_at_gregdunn.com)
Date: 05/16/03
- Next message: Tom O: "Re: Define column as nchar (unicode) to store encrypted data?"
- Previous message: sidd khare: "Re: Integrated security -whose credentials are used?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 15 May 2003 15:40:59 -0700
While experimenting with different options for saving session state in a
Visual Studio app, I got round to the option for storing the state in SQL
Server. The following is the complete web.config file for the sample app I'm
running (password changed):
<configuration>
<appSettings>
<add key="connectString"
value="server=localhost;database=pubs;uid=sa;pwd=whatever" />
</appSettings>
<system.web>
<compilation defaultLanguage="C#" debug="true">
</compilation>
<sessionState mode="SQLServer"
sqlConnectionString="server=localhost;uid=sa;pwd=whatever" />
</system.web>
</configuration>
That results in the error message shown in the subject, even though 'sa' is
a defined login on the database, with the specified password, System Admin
permissions, and owner access to all databases. In the absence of the
sessionState statement (so the app runs with the default in-proc session
state), the app works fine
Q: What is causing the login failure?
I am appending the complete error message below in case it is needed.
--
Greg Dunn
Server Error in '/Congo' Application.
----------------------------------------------------------------------------
----
Cannot open database requested in login 'ASPState'. Login fails. Login
failed for user 'sa'.
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
requested in login 'ASPState'. Login fails. Login failed for user 'sa'.
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: Cannot open database requested in login 'ASPState'. Login
fails.
Login failed for user 'sa'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
System.Web.SessionState.SqlStateConnection..ctor(String
sqlconnectionstring)
[HttpException (0x80004005): Unable to connect to SQL Server session
database.]
System.Web.SessionState.SqlStateConnection..ctor(String
sqlconnectionstring)
System.Web.SessionState.SqlStateClientManager.GetConnection(Boolean&
usePooling)
System.Web.SessionState.SqlStateClientManager.SetAsyncWorker(String id,
SessionStateItem item, Byte[] buf, Int32 length, Boolean inStorage)
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IState
ClientManager.Set(String id, SessionStateItem item, Boolean inStorage)
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs)
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.
Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
- Next message: Tom O: "Re: Define column as nchar (unicode) to store encrypted data?"
- Previous message: sidd khare: "Re: Integrated security -whose credentials are used?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|