Thanks for your reply
The following is the function which I used to call from a class file
private void getUserInfo(string userid)
{
sqlDataAccess sda = new sqlDataAccess(ConfigurationSettings.AppSettings["constring"],"Global");
string sessid = HttpContext.Current.Session.Contents.SessionID;
object[] parameters = {userid,sessid};
DataSet ds = sda.executeSqlReturnDataSet("proc_getuserinfo",CommandType.StoredProcedure,parameters);
if (ds.Tables[0].Rows.Count >= 1)
{
_officeid = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
_username = ds.Tables[0].Rows[0][1].ToString();
_officename = ds.Tables[0].Rows[0][2].ToString();
_gid = ds.Tables[0].Rows[0][8].ToString();
_officeaddress = ds.Tables[0].Rows[0][9].ToString();
_pid=ds.Tables[0].Rows[0][10].ToString();
_slot=Convert.ToInt32(ds.Tables[0].Rows[0][11].ToString());
}
sda.cleanUp();
}
string sessid = HttpContext.Current.Session.Contents.SessionID;
I am getting error in the above line. Though I could pass session id from a web page. The above code will considerably save lots of line in main pages.