Server Error in '/ICDL' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 154:            DataSet dsCenter = new DataSet();
Line 155:            tbCenterUsers tbcenter = new tbCenterUsers();
Line 156:            dsCenter = tbcenter.SelectCcodeNameByUid(int.Parse(Session["Uid"].ToString()));
Line 157:            string code = "";
Line 158:            if (dsCenter.Tables["tbCenterUsers"].Rows.Count > 0)

Source File: D:\ICDL_Web -1396-04-17\ICDL_Web\Result\ShowResult.aspx.cs    Line: 156

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ICDL_Web.Result.ShowResult.CenterCode() in D:\ICDL_Web -1396-04-17\ICDL_Web\Result\ShowResult.aspx.cs:156
   ICDL_Web.Result.ShowResult.Page_Init(Object sender, EventArgs e) in D:\ICDL_Web -1396-04-17\ICDL_Web\Result\ShowResult.aspx.cs:38
   System.Web.UI.Control.OnInit(EventArgs e) +107
   System.Web.UI.Page.OnInit(EventArgs e) +16
   System.Web.UI.Control.InitRecursive(Control namingContainer) +172
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +490


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0