I want to display user, like Welcome, (user).
welcome,
................................................................................................................................................................
protected void Page_Load(object sender, EventArgs e)
{
try
{
DataSet dsUser = (DataSet)Session["USER"];
if (dsUser.Tables[0].Rows.Count > 0)
{
agentCode = dsUser.Tables[0].Rows[0]["Agent_code"].ToString();
userType = dsUser.Tables[0].Rows[0]["User_type"].ToString();
username = dsUser.Tables[0].Rows[0]["Agent_code"].ToString();
usermail = dsUser.Tables[0].Rows[0]["Email"].ToString();
}
else
{
logout();
}
}
catch (Exception ex)
{
string err = ex.Message;
logout();
}
..Thanks
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
nallyaPosted Oct 29, 2012, 5:37 AM
This Article explained Well:
http://www.devmanuals.com/tutorials/ms/aspdotnet/session.html
Santhosh Kumar JayaramanPosted Oct 29, 2012, 5:34 AM
if (dsUser.Tables[0].Rows.Count > 0)
{
agentCode = dsUser.Tables[0].Rows[0]["Agent_code"].ToString();
Session["Agent_code"]=agentcode;