Server Error in '/' 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 63:         string sql = @"select count(*) " + MyStaticData.SQLTinTuc(t);
Line 64:         DataTable tbTotalRows = Connect.GetTable(sql);
Line 65:         int TotalRows = int.Parse(tbTotalRows.Rows[0][0].ToString());
Line 66:         if (TotalRows % PageSize == 0)
Line 67:             MaxPage = TotalRows / PageSize;

Source File: c:\inetpub\wwwroot\PMYumo\Views\TinTuc\TinTuc.aspx.cs    Line: 65

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   View_TinTuc_TinTuc.SetPage() in c:\inetpub\wwwroot\PMYumo\Views\TinTuc\TinTuc.aspx.cs:65
   View_TinTuc_TinTuc.LoadSanPham() in c:\inetpub\wwwroot\PMYumo\Views\TinTuc\TinTuc.aspx.cs:164
   View_TinTuc_TinTuc.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\PMYumo\Views\TinTuc\TinTuc.aspx.cs:44
   System.Web.UI.Control.OnLoad(EventArgs e) +102
   System.Web.UI.Control.LoadRecursive() +67
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1380


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