Session state using SQLSERVER
Hi
I am tring to store session variables in sql server
for that i have made following cjanges:
in web.config:
:o and run InstallSQlstate.sql from this folder
C:\WINNT\Microsoft.NET\Framework\v1.0.3705
i have witten following code for this
private void Button1_Click(object sender, System.EventArgs e)
{
Session["Se"]= TextBox1.Text;
Response.Write(Session["Se"].ToString());
}
Now I am not able to store my session data is sql Server.
can anybody know..anything more to do to get session data.
thanks in advance.
PPCC
Re: Session state using SQLSERVER
Save Value in Cookies
for store value
Response.Cookies["SessionName"].Value = textBox.text;
for get value
string SessionID = (string)Request.Cookies["SessionName"].Value;
Re: Session state using SQLSERVER
it means i can't store values in SQL server...then what is this SessinState element in web.config file does
Re: Session state using SQLSERVER
no u can also store in SQL server but its better put valuse in session variable
EnableSessionState="false"
Re: Session state using SQLSERVER
hey man i don't understand where to write EnableSessionState="false neither page nor web.config allowed.
Re: Session state using SQLSERVER
<%@ Page language="c#" Codebehind="SignIn.aspx.cs" AutoEventWireup="false" Inherits="Sample.Web.SignIn" EnableSessionState="false" EnableViewState="false" %>
IN html Portion
Re: Session state using SQLSERVER
Hi PPCC
What error messages do you get when you try to save to the sql server session state?
Chris Seary
Re: Session state using SQLSERVER
Quote:
Originally Posted by oldbear
Hi PPCC
What error messages do you get when you try to save to the sql server session state?
Chris Seary
No error message but can't stored value in SQL server.
Re: Session state using SQLSERVER
Did you add:
Code:
<sessionState
mode="SQLServer"
sqlConnectionString="data source=server;user id=uid;password=pwd"
cookieless="false" timeout="20" />
in web.config?
Re: Session state using SQLSERVER
Quote:
Originally Posted by mendhak
Did you add:
Code:
<sessionState
mode="SQLServer"
sqlConnectionString="data source=server;user id=uid;password=pwd"
cookieless="false" timeout="20" />
in web.config?
yes i added that in web.config file..but no luck
Re: Session state using SQLSERVER
hi buddies,I am looking in ASPStateTempSessions table..Hope session data get stored here.