|
 |
aspx thread: Using sessions with an SQL database
Message #1 by "McCloy, Russell" <Russell.McCloy@B...> on Fri, 12 Apr 2002 08:37:23 +1000
|
|
Hello all,
I am attempting to use session objects.
Instead of using memory on the server I want to use an SQL database.
I found a script in my .NET framework that creates an ASPState database.
All is well with the database but my web.config file is not working. Here is
the error:
=========================== E R R O R
==========================================================================
Server Error in '/ManualDisbursementsSystem' Application.
----------------------------------------------------------------------------
----
SQL Server does not exist or access denied.
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: SQL Server does not
exist or access denied.
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: SQL Server does not exist or access denied.]
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()
System.Web.SessionState.SqlStateClientManager.SetAsyncWorker(String id,
SessionStateItem item, Boolean inStorage)
System.Web.SessionState.SqlStateClientManager.Set(String id,
SessionStateItem item, Boolean inStorage)
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs) +466
System.Web.SyncEventExecutionStep.Execute() +60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87
----------------------------------------------------------------------------
----
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET
Version:1.0.3705.0
============================================================================
========================================
Here is my code:
================================ M Y C O D
E=======================================================================
<sessionState mode="SQLServer"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="server=SYD2KDPRWD01; data source=ASPState; user id=sa;
pwd="
cookieless="false"
timeout="20" />
============================================================================
========================================
The server name is SYD2KDPRWD01 and always works for me.
The database is called ASPState and I can connect to it through query
analyser.
Of course "sa" has no password as out dba has no idea!
Any ideas anyone?
thanks
RuSs
Message #2 by Imar Spaanjaars <Imar@S...> on Fri, 12 Apr 2002 13:10:32 +0200
|
|
Did you restart SQL Server after you ran the script? The script modifies
some SQL settings that only get active when SQL Server is restarted.
HtH
Imar
At 08:37 AM 4/12/2002 +1000, you wrote:
>Hello all,
>
>I am attempting to use session objects.
>Instead of using memory on the server I want to use an SQL database.
>I found a script in my .NET framework that creates an ASPState database.
>All is well with the database but my web.config file is not working. Here is
>the error:
>
>=========================== E R R O R
>==========================================================================
>Server Error in '/ManualDisbursementsSystem' Application.
>----------------------------------------------------------------------------
>----
>
>SQL Server does not exist or access denied.
>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: SQL Server does not
>exist or access denied.
>
>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: SQL Server does not exist or access denied.]
> 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()
> System.Web.SessionState.SqlStateClientManager.SetAsyncWorker(String id,
>SessionStateItem item, Boolean inStorage)
> System.Web.SessionState.SqlStateClientManager.Set(String id,
>SessionStateItem item, Boolean inStorage)
> System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
>EventArgs eventArgs) +466
> System.Web.SyncEventExecutionStep.Execute() +60
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
>completedSynchronously) +87
>
>----------------------------------------------------------------------------
>----
>Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET
>Version:1.0.3705.0
>
>============================================================================
>========================================
>
>Here is my code:
>================================ M Y C O D
>E=======================================================================
><sessionState mode="SQLServer"
>stateConnectionString="tcpip=127.0.0.1:42424"
>sqlConnectionString="server=SYD2KDPRWD01; data source=ASPState; user id=sa;
>pwd="
>cookieless="false"
>timeout="20" />
>============================================================================
>========================================
>
>The server name is SYD2KDPRWD01 and always works for me.
>The database is called ASPState and I can connect to it through query
>analyser.
>Of course "sa" has no password as out dba has no idea!
>
>Any ideas anyone?
>
>thanks
>
>RuSs
>
>
Message #3 by Imar Spaanjaars <Imar@S...> on Fri, 12 Apr 2002 13:15:26 +0200
|
|
Oh, one more thing. The setting in Web.Config should be like this:
<sessionState
mode="SQLServer"
cookieless="false"
timeout="20"
sqlConnectionString="data source=192.168.1.20;Trusted_Connection=Yes"
/>
So the servername (or IP address) should be part of the data source. No
need to mention the database explicitly.
Replace Trusted_Connection=Yes with user id=sa;pwd= if you want to use SQL
Authentication instead of Windows authentication.
HtH
Imar
At 01:10 PM 4/12/2002 +0200, you wrote:
>Did you restart SQL Server after you ran the script? The script modifies
>some SQL settings that only get active when SQL Server is restarted.
>
>HtH
>
>Imar
>
>
>At 08:37 AM 4/12/2002 +1000, you wrote:
>>Hello all,
>>
>>I am attempting to use session objects.
>>Instead of using memory on the server I want to use an SQL database.
>>I found a script in my .NET framework that creates an ASPState database.
>>All is well with the database but my web.config file is not working. Here is
>>the error:
>>
>>=========================== E R R O R
>>==========================================================================
>>Server Error in '/ManualDisbursementsSystem' Application.
>>----------------------------------------------------------------------------
>>----
>>
>>SQL Server does not exist or access denied.
>>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: SQL Server does not
>>exist or access denied.
>>
>>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: SQL Server does not exist or access denied.]
>> 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()
>> System.Web.SessionState.SqlStateClientManager.SetAsyncWorker(String id,
>>SessionStateItem item, Boolean inStorage)
>> System.Web.SessionState.SqlStateClientManager.Set(String id,
>>SessionStateItem item, Boolean inStorage)
>> System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
>>EventArgs eventArgs) +466
>> System.Web.SyncEventExecutionStep.Execute() +60
>> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
>>completedSynchronously) +87
>>
>>----------------------------------------------------------------------------
>>----
>>Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET
>>Version:1.0.3705.0
>>
>>============================================================================
>>========================================
>>
>>Here is my code:
>>================================ M Y C O D
>>E=======================================================================
>><sessionState mode="SQLServer"
>>stateConnectionString="tcpip=127.0.0.1:42424"
>>sqlConnectionString="server=SYD2KDPRWD01; data source=ASPState; user id=sa;
>>pwd="
>>cookieless="false"
>>timeout="20" />
>>============================================================================
>>========================================
>>
>>The server name is SYD2KDPRWD01 and always works for me.
>>The database is called ASPState and I can connect to it through query
>>analyser.
>>Of course "sa" has no password as out dba has no idea!
>>
>>Any ideas anyone?
>>
>>thanks
>>
>>RuSs
>>
>>
>
>
>
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or to
>unsubscribe send a blank email to
|
|
 |