Welcome to Bilal Haidar [MVP, MCT] Official Blog Sign in | Join | Help

Problem in SQL Server Session State - ASP.NET 3.5

*** Updated - April 7 2008  ***

I played a little bit with the command line I am using to install the SQL Server Session State database and it seems to work fine: To register the database for the SQL Server Session State on ASP.NET 2.0 or ASP.NET 3.5:

aspnet_regsql -C "Data Source=.;Integrated Security=True" -ssadd -sstype c -d SessionStateDB

In addition to this, you might need to grant access to: 'NT AUTHORITY\NETWORK SERVICE' on your database

Hope this solves your problem as it solved mine!!
Regards 

*** Updated - April 7 2008  ***

 

I enabled a database with the schema tables used for SQL Server Session State as follows:

aspnet_regsql -S .\ -d aspnetdb -E -sstype c -ssadd

 

Then in the web.config file, I enabled SessionState as follows:

<sessionState 
   
allowCustomSqlDatabase="true"
   
mode="SQLServer"
   
sqlConnectionString="data source=.\;initial catalog=aspnetdb;trusted_connection=true"
   
timeout="20" />

 

When I run my page, I recieve the following exception:

Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.

 

It sounds strange, I am using the 2.0 version of the script!! Any ideas?

Thanks

Published Sunday, April 06, 2008 8:11 AM by BilalHaidar [MVP]

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Problem in SQL Server Session State - ASP.NET 3.5

You only need to grant access to network if you are using trusted connections. I wouldn't recommend that, unless you are in a tightly closed environment. I run a distributed team, and recommend keeping a local session state server, that uses a real user locally.

Tuesday, June 10, 2008 5:24 AM by Chris

# re: Problem in SQL Server Session State - ASP.NET 3.5

Hi Chris,

Thanks for the comment.

Do you mean I shall create a special username and assign it as a username instead of the network service?

Thanks

Tuesday, June 10, 2008 12:42 PM by BilalHaidar [MVP]

Leave a Comment

(required) 
required 
(required)