O
oj
Could someone explain to me why the following code snippet throws an
"Object Reference not set to an instance of an object error":
public void SetActiveStaffMember(int staffMemberId)
{
DAL.StaffMemberDataSet smDS = new DAL.StaffMemberDataSet();
if(GetStaffMemberById(staffMemberId) == 0)
smDS = staffMemberDS;
System.Web.HttpContext.Current.Session["smDS"] = smDS;
}
and why the following code does not throw the error:
public void SetActiveStaffMember(int staffMemberId)
{
DAL.StaffMemberDataSet smDS = new DAL.StaffMemberDataSet();
if(GetStaffMemberById(staffMemberId) == 0)
smDS = staffMemberDS;
}
I would like to track Session state for the dataset member of my
business object class, but it seems that this is causing the issue.
Any info. is appreciated.
"Object Reference not set to an instance of an object error":
public void SetActiveStaffMember(int staffMemberId)
{
DAL.StaffMemberDataSet smDS = new DAL.StaffMemberDataSet();
if(GetStaffMemberById(staffMemberId) == 0)
smDS = staffMemberDS;
System.Web.HttpContext.Current.Session["smDS"] = smDS;
}
and why the following code does not throw the error:
public void SetActiveStaffMember(int staffMemberId)
{
DAL.StaffMemberDataSet smDS = new DAL.StaffMemberDataSet();
if(GetStaffMemberById(staffMemberId) == 0)
smDS = staffMemberDS;
}
I would like to track Session state for the dataset member of my
business object class, but it seems that this is causing the issue.
Any info. is appreciated.