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 570:            ",'SoHoiDap' = (select count(*) from tb_HoiDapSanPham cs where cs.idLoaiSanPham = lsp.idLoaiSanPham and isCauHoi = 1),'SLBan' = " + MyStaticData.SQLSUMSoLuongBanSanPham() + MyStaticData.sqlLaySanPhamGianHang(t, new ModelSanPham(), "Web") + " and lsp.IDLoaiSanPham =" + pIDSanPham + "";
Line 571:        DataTable table = Connect.GetTable(sql);
Line 572:        if (table.Rows.Count > 0)
Line 573:        {
Line 574:            idGHSP = table.Rows[0]["idGianHang"].ToString();

Source File: c:\inetpub\wwwroot\PMYumo\Views\SanPham\ChiTietSanPham.aspx.cs    Line: 572

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   DanhMuc_DanhMucHangHoa_CapNhat.LoadThongTinSP() in c:\inetpub\wwwroot\PMYumo\Views\SanPham\ChiTietSanPham.aspx.cs:572
   DanhMuc_DanhMucHangHoa_CapNhat.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\PMYumo\Views\SanPham\ChiTietSanPham.aspx.cs:38
   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