Geeks With Blogs

Steve Clements .Net and then some....

I am having huge problems with setting up SQL session state for my app.  I have run the aspnet_regsql.exe tool and the database has been created correctly with the user id etc.
However nothing is saved in the session...i can look at the sql tables and see that in the TempApps table i have my application, when i look in the TempSession table i don't have any rows.

I have tried to do something very simple like this...

Master.PageTitle is just the text property of a label control.

if (Session["test"] != null)

   Master.PageTitle = Session["test"].ToString();

else {

   Session["test"] = "Hello from SQL session";

   Master.PageTitle = "Yes i am null";



Master.PageTitle += Session["test"].ToString();

The property is always "Yes i am nullHello from SQL session"

So the Session is set but when i postback to the server again the session is null.???
The exact same code works in InProc mode, and so does the rest of my Session management code.
I am normally storing an object which i have set as [Serializable]

In my web.config i have

<sessionState mode="SQLServer"

sqlConnectionString="user id=<userid>; password=<password>; data source=server1;"

cookieless="AutoDetect" />

Is there something i am missing?? I have followed the msdn to the T, just seems like i am missing something?




I found this issue the other day....I was trying to serialize a DataView object...doh!

Posted on Friday, September 1, 2006 7:27 PM | Back to top

Comments on this post: HELP! SQL Session State in 2.0

# re: HELP! SQL Session State in 2.0
Requesting Gravatar...
pls visit for the resolution
Left by Ganesh on Mar 31, 2008 12:08 PM

Your comment:
 (will show your gravatar)

Copyright © Steve Clements | Powered by: