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.
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...
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--------------->