G
Guest
Hi Steve,
Please find the code snippets below:
Method A inside User Control A:
-------------------------------------------
public void LoadDataGrid()
{
DataSet ds = new DataSet();
string[] sqlString = new string[2];
sqlString[0] = " SELECT REQ_CLIENT.ID,FIRSTNAME ||' '|| LASTNAME
NAME,COMPANY,COUNTY, "+ " DECODE(REQ_CLIENT.ID,BILLING_CONTACT,1,0)
IS_BILLING_PERSON "+ " FROM REQ_CLIENT,REQ_QUEUE WHERE "+
" REQ_QUEUE.ID = ID_REQ_QUEUE AND "+" ID_REQ_QUEUE=
"+Session["ID_REQ_QUEUE"].ToString()+" ORDER BY UPPER(LASTNAME) ";
.........
.........
.........
-------------------------------------------------
The way I am calling the User Control A from Control B is as follows by
instantiating an object of the Control class:
secure.NewDiagnostics.Requester.Contacts1 parentControl = new
secure.NewDiagnostics.Requester.Contacts1();
if(this.Parent!=null)
{
parentControl.LoadDataGrid();
}
So when control goes back to the LoadDataGrid method in the parent control I
get the following error:
ErrorMessage:
----------------
Object reference not set to an instance of an object.
ErrorSource: System.Web
ErrorTargetSite:
----------------
System.Web.SessionState.HttpSessionState get_Session()
ErrorTrace:
----------------
at System.Web.UI.UserControl.get_Session()
at secure.NewDiagnostics.Requester.Contacts1.LoadDataGrid() in
c:\inetpub\wwwroot\intranet.pdis.org\diagnostics\submitter\contacts1.ascx.cs:line 522
At line 522, there is an SQL query which is accessing a session variable.
Any pointers?
Thanks!!
Please find the code snippets below:
Method A inside User Control A:
-------------------------------------------
public void LoadDataGrid()
{
DataSet ds = new DataSet();
string[] sqlString = new string[2];
sqlString[0] = " SELECT REQ_CLIENT.ID,FIRSTNAME ||' '|| LASTNAME
NAME,COMPANY,COUNTY, "+ " DECODE(REQ_CLIENT.ID,BILLING_CONTACT,1,0)
IS_BILLING_PERSON "+ " FROM REQ_CLIENT,REQ_QUEUE WHERE "+
" REQ_QUEUE.ID = ID_REQ_QUEUE AND "+" ID_REQ_QUEUE=
"+Session["ID_REQ_QUEUE"].ToString()+" ORDER BY UPPER(LASTNAME) ";
.........
.........
.........
-------------------------------------------------
The way I am calling the User Control A from Control B is as follows by
instantiating an object of the Control class:
secure.NewDiagnostics.Requester.Contacts1 parentControl = new
secure.NewDiagnostics.Requester.Contacts1();
if(this.Parent!=null)
{
parentControl.LoadDataGrid();
}
So when control goes back to the LoadDataGrid method in the parent control I
get the following error:
ErrorMessage:
----------------
Object reference not set to an instance of an object.
ErrorSource: System.Web
ErrorTargetSite:
----------------
System.Web.SessionState.HttpSessionState get_Session()
ErrorTrace:
----------------
at System.Web.UI.UserControl.get_Session()
at secure.NewDiagnostics.Requester.Contacts1.LoadDataGrid() in
c:\inetpub\wwwroot\intranet.pdis.org\diagnostics\submitter\contacts1.ascx.cs:line 522
At line 522, there is an SQL query which is accessing a session variable.
Any pointers?
Thanks!!