public void call() { clsDistributor objDistributor = new clsDistributor(); objDistributor.UserId = Convert.ToInt32(Session["ConsumerId"]); DataSet ds = objDistributor.ShowConnectionDetailsByuser(); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; Session["AgentId"] = dr["AgentId"].ToString(); } lblUserName.Text = Session["UserName"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { clsDistributor objDistributor = new clsDistributor(); objDistributor.UserId = Convert.ToInt32(Session["ConsumerId"]); DataSet ds = objDistributor.ShowConnectionDetailsByuser(); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; Session["AgentId"] = dr["AgentId"].ToString(); } lblUserName.Text = Session["UserName"].ToString(); }