|
-
Feb 20th, 2006, 03:55 AM
#1
Thread Starter
Hyperactive Member
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:
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
-
Feb 20th, 2006, 04:09 AM
#2
Addicted Member
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;
-
Feb 20th, 2006, 04:26 AM
#3
Thread Starter
Hyperactive Member
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
-
Feb 20th, 2006, 04:31 AM
#4
Addicted Member
Re: Session state using SQLSERVER
no u can also store in SQL server but its better put valuse in session variable
EnableSessionState="false"
-
Feb 20th, 2006, 04:57 AM
#5
Thread Starter
Hyperactive Member
Re: Session state using SQLSERVER
hey man i don't understand where to write EnableSessionState="false neither page nor web.config allowed.
-
Feb 20th, 2006, 05:03 AM
#6
Addicted Member
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
-
Feb 20th, 2006, 05:09 AM
#7
Member
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
-
Feb 20th, 2006, 05:18 AM
#8
Thread Starter
Hyperactive Member
Re: Session state using SQLSERVER
 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.
-
Feb 20th, 2006, 05:23 AM
#9
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?
-
Feb 20th, 2006, 05:34 AM
#10
Thread Starter
Hyperactive Member
Re: Session state using SQLSERVER
 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
-
Feb 20th, 2006, 05:43 AM
#11
Thread Starter
Hyperactive Member
Re: Session state using SQLSERVER
hi buddies,I am looking in ASPStateTempSessions table..Hope session data get stored here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|