i v stored some database driven values into session variables at the time of login(i.e user id,user name cetc..)..while running this website in localhost(iis)this works fine. but while i upload this in windows webserver without giving ne error it seems that session variables failed to store the data(after logging in while navigating through the website session variables become null).but the confusing thing is that somtimes itz working..
sessionState mode is default for windows server
please help
following is the code
string sSqlCmd = "SELECT eum_id, eum_uid, eum_pwd, eum_name, edm_name, eum_evm_id,eum_edm_id FROM ei_user_master,ei_dealer_master where eum_edm_id = " + ddlDealer.SelectedValue + " and eum_uid = '" + txtUser.Text + "' and eum_evm_id = " + cmbDept.SelectedValue + "";
// Open the database
conn.Open();
OleDbDataReader dr;
OleDbCommand cmd = new OleDbCommand(sSqlCmd, conn);
dr = cmd.ExecuteReader();
dr.Read();
if (!dr.HasRows)
{
FailureText.Text = "invalid username/dealer of/dealer name";
conn.Close();
}
else
{
if (dr["eum_pwd"].ToString() != txtPwd.Text)
{
FailureText.Text = "invalid password";
conn.Close();
}
else
{
try
{
Session["UidER"] = dr["eum_id"];
Session["UserName"] = dr["eum_name"];
Session["DealerName"] = dr["edm_name"];
Session["VehicleID"] = dr["eum_evm_id"];
Session["DealerID"] = dr["eum_edm_id"];
conn.Close();
}
catch (Exception ex)
{
}
finally
{
Response.Redirect("Configuration.aspx");
}
}
}
please help