Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SQL Session State

Reply
Thread Tools

SQL Session State

 
 
Ahmed Hashish
Guest
Posts: n/a
 
      03-15-2006
Dear All
I'm trying to use the sql server 2005 to store my web application session variables,
First I modified the web.config as follows:
<sessionState mode="SQLServer"

cookieless="true"

regenerateExpiredSessionId="true"

timeout="60"

sqlConnectionString="Data Source=ServerName\InstanceName;user Id=myuser;pwd=mypwd"

stateNetworkTimeout="60"/>

Second:

I installed the file Windows\Microsoft.Net\Framework\v2.0.50727\Install SqlState.sql

Third:

The problem that when I tried to run my application an error:

"Cannot open database "ASPState" requested by the login. The login failed.
Login failed for user 'MyUser'"

What Permissions I need to add to that user to allow login to the database?

 
Reply With Quote
 
 
 
 
Winista
Guest
Posts: n/a
 
      03-15-2006
You need to create a user account "MyUser" in SQL server. And make sure that your SQL Server is set for mixed mode authentication.


--
Netomatix
http://www.netomatix.com
"Ahmed Hashish" <> wrote in message news:OYgA$...
Dear All
I'm trying to use the sql server 2005 to store my web application session variables,
First I modified the web.config as follows:
<sessionState mode="SQLServer"

cookieless="true"

regenerateExpiredSessionId="true"

timeout="60"

sqlConnectionString="Data Source=ServerName\InstanceName;user Id=myuser;pwd=mypwd"

stateNetworkTimeout="60"/>

Second:

I installed the file Windows\Microsoft.Net\Framework\v2.0.50727\Install SqlState.sql

Third:

The problem that when I tried to run my application an error:

"Cannot open database "ASPState" requested by the login. The login failed.
Login failed for user 'MyUser'"

What Permissions I need to add to that user to allow login to the database?

 
Reply With Quote
 
Ahmed Hashish
Guest
Posts: n/a
 
      03-15-2006
I already done this but it gives another error "
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. "

"Winista" <> wrote in message news:...
You need to create a user account "MyUser" in SQL server. And make sure that your SQL Server is set for mixed mode authentication.


--
Netomatix
http://www.netomatix.com
"Ahmed Hashish" <> wrote in message news:OYgA$...
Dear All
I'm trying to use the sql server 2005 to store my web application session variables,
First I modified the web.config as follows:
<sessionState mode="SQLServer"

cookieless="true"

regenerateExpiredSessionId="true"

timeout="60"

sqlConnectionString="Data Source=ServerName\InstanceName;user Id=myuser;pwd=mypwd"

stateNetworkTimeout="60"/>

Second:

I installed the file Windows\Microsoft.Net\Framework\v2.0.50727\Install SqlState.sql

Third:

The problem that when I tried to run my application an error:

"Cannot open database "ASPState" requested by the login. The login failed.
Login failed for user 'MyUser'"

What Permissions I need to add to that user to allow login to the database?

 
Reply With Quote
 
karin karin is offline
Junior Member
Join Date: Jul 2006
Posts: 2
 
      07-31-2006
I got that same error because I had failed to set the proper permissions, like so:

USE ServerName

GO
EXECUTE sp_grantdbaccess myuser
GO
GRANT EXECUTE on CreateTempTables to myuser
GRANT EXECUTE on DeleteExpiredSessions to myuser
GRANT EXECUTE on GetHashCode to myuser
GRANT EXECUTE on GetMajorVersion to myuser
GRANT EXECUTE on TempInsertUninitializedItem to myuser
GRANT EXECUTE on TempGetAppId to myuser
GRANT EXECUTE on TempInsertStateItemShort to myuser
GRANT EXECUTE on TempGetStateItem to myuser
GRANT EXECUTE on TempGetStateItem2 to myuser
GRANT EXECUTE on TempGetStateItem3 to myuser
GRANT EXECUTE on TempGetStateItemExclusive to myuser
GRANT EXECUTE on TempGetStateItemExclusive2 to myuser
GRANT EXECUTE on TempGetStateItemExclusive3 to myuser
GRANT EXECUTE on TempGetVersion to myuser
GRANT EXECUTE on TempInsertStateItemLong to myuser
GRANT EXECUTE on TempReleaseStateItemExclusive to myuser
GRANT EXECUTE on TempRemoveStateItem to myuser
GRANT EXECUTE on TempResetTimeout to myuser
GRANT EXECUTE on TempUpdateStateItemLong to myuser
GRANT EXECUTE on TempUpdateStateItemLongNullShort to myuser
GRANT EXECUTE on TempUpdateStateItemShort to myuser
GRANT EXECUTE on TempUpdateStateItemShortNullLong to myuser
GO

GRANT SELECT on ASPStateTempApplications to myuser
GRANT INSERT on ASPStateTempApplications to myuser
GRANT SELECT on ASPStateTempSessions to myuser
GRANT INSERT on ASPStateTempSessions to myuser
GRANT UPDATE on ASPStateTempSessions to myuser

GO
 
Reply With Quote
 
karin karin is offline
Junior Member
Join Date: Jul 2006
Posts: 2
 
      07-31-2006
Also, don't use the old scripts from SQL Server 2000 to create the Session State Database. They won't work for ASP.NET 2.0. Use aspnet_regsql.exe instead, like so:

aspnet_regsql -C "Data Source=INCFITSYSDB01;Integrated Security=True" -ssadd -sstype c -d MySessionDB
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to make the session state request to the session state server. dm1608 ASP .Net 3 12-19-2009 02:32 AM
HttpException (0x8007274d): Unable to make the session state request to the session state server. Harry Haller ASP .Net 0 11-07-2006 05:33 AM
Unable to make the session state request to the session state server Maciek ASP .Net 0 09-15-2005 08:49 PM
Unable to make the session state request to the session state server Not Liking Dot Net Today ASP .Net 0 04-21-2004 11:54 AM
unable to make the session state request to the session state server shamanthakamani ASP .Net 1 11-20-2003 03:51 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57