How to configure SQL Server to use the SQL Server Session Management in ASP .NET?
Posted on | August 6, 2008 | No Comments
ASP.NET offers three session management solutions. They are:
- InProcess,
- StateServer (outProcess),
- SQLServer (based on the database)
Today I spent about 3 hours just to get the configuration right for using this third type called SQLServer based Session State Management. I ended up configuring it on SQL Server 2000,
Well, in short this is what my command looked like:-
aspnet_regsql -ssadd -S <Database Server Name> -U <DB User Name> -P <DB User’s Password>
Curious about the switches used here:
Over the application end, you need to make the following changes in your web.config file.
<system.web>
…
<sessionState mode=“SQLServer“ sqlConnectionString=“Data Source=DATABASE_SERVER_NAME;Initial Catalog=aspState;Persist Security Info=True;User ID=DBUSER_NAME;Password=DB_PASSWORD;“ allowCustomSqlDatabase=“true“ >
</
</system.web>
Its very important that you set the allowCustomSqlDatabase=“true” coz you wont be able to get it running without this — atleast that’s what I’ve learnt in the last 3-4 hours.
Hope that helps,
Happy programming!
Category: ASP .NET
Tags: ASP .NET > aspnet_regsql > session in Db > Session Sql server > Session State in DB > Session state management > use aspnet_regsql to configure Database
Tags: ASP .NET > aspnet_regsql > session in Db > Session Sql server > Session State in DB > Session state management > use aspnet_regsql to configure Database
Comments
Leave a Reply




