ASP.NET SQL Server Session - Links and Overview - Jon Galloway

ASP.NET SQL Server Session - Links and Overview

A co-worker asked me about setting up SQL Server Session state. Here's what I told him:

Basic steps to set up SQL Server Session state

1. Run either of these scripts (InstallSqlState uses temp tables, InstallPersistSqlState uses permanent tables so it survives reboots)
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallSqlState.sql
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallPersistSqlState.sql

2. Change your session state mode in web.config to SQLServer:
<sessionState
  mode="SQLServer"
  sqlConnectionString="data source=server;user id=uid;password=pwd"
  cookieless="false" timeout="20" />

References

Good overview http://idunno.org/dotNet/sessionState.aspx

MSDN overview of SQL Server Session State
http://support.microsoft.com/default.aspx?kbid=311209

[UPDATE]
Another good article with information on granting permissions on SQL Server:
http://www.dbazine.com/cook9.shtml

Common issues

325056 PRB: Session State Is Lost in Web Farm If You Use SqlServer or
http://support.microsoft.com/?id=325056
323744 FIX: "The View State Is Invalid for This Page and Might Be Corrupted"
http://support.microsoft.com/?id=323744

Published Monday, October 18, 2004 11:06 AM by Jon Galloway
Filed under:

Comments

# re: ASP.NET SQL Server Session - Links and Overview

Hi,

Can you pls brief on what will be issues in using SQL to store the session.

Pls mail me at sadhasivam1981@yahoo.com, sadhasivam1981@gmail.com.

With regards,

Sadha Sivam S,
Microsoft Community Star,

Friday, October 29, 2004 6:27 AM by Sadha Sivam

Leave a Comment

(required) 
(required) 
(optional)
(required)