How to configure SQL Server Session State

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone please guide me how to configure SQL Server session state. I have configured upto an extent, but it is giving error.
 
Error Message is:
Unable to find the data source/Data Source doesnot Exist.
But my data source is available and exist properly.
 
Hmm. Really there are only two steps:

1) Run one of the SQL state .sql scripts from
systemroot\Microsoft.NET\Framework\versionNumber.

2) Set the sessionState element in web.config to mode="SQLServer" and
the correct sqlConnectionString.

If you have trouble finding the data source, I'd double check the
connection string in 2. Also check to see if the user has permissions
to access the state database.

--s
 
Dear Allen,
Thanks for your tips.
But the problem is not solved yet. I am unable to identify where is the problem. In my computer only one ASP.NET application is running and session state in SQL Server is maintained successfully. In my deployment machine, there are 7 ASP.NET applications are running. There, the problem arises...
 
Hi
Here's a Microsoft KB link.

Using one SQL database for all applications for SQL Server session state may cause a bottleneck.
http://support.microsoft.com/default.aspx?scid=kb;en-us;820782

Verify your web.config file...
<----CODE STARTS-------------->
<sessionState
mode="SQLServer"
allowCustomSqlDatabase="true" <!--This line is a new attribute to sessionState. -->
sqlConnectionString="data source=127.0.0.1;database=mydatabase;user id=<username>;password=<strong password>"
cookieless="false"
timeout="20"
/>
<---CODE ENDS--------------->
 
Back
Top