Server Error in '/' Application.

The source contains no DataRows.

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.InvalidOperationException: The source contains no DataRows.

Source Error:


Line 178:            oLbl = new Label();
Line 179:            sbLbl = new StringBuilder();
Line 180:            DataTable dtSubMenu = dtMenu.AsEnumerable().Where(a => a.Field<string>("ParentMenuId").CompareTo(MainMenuId) == 0 && a.Field<string>("MenuId").Substring(0, 3).CompareTo("img") != 0).CopyToDataTable();
Line 181:
Line 182:            try

Source File: d:\Websites\APC\App_Code\Ivy.WebLib.cs    Line: 180

Stack Trace:


[InvalidOperationException: The source contains no DataRows.]
   System.Data.DataTableExtensions.LoadTableFromEnumerable(IEnumerable`1 source, DataTable table, Nullable`1 options, FillErrorEventHandler errorHandler) +1150
   System.Data.DataTableExtensions.CopyToDataTable(IEnumerable`1 source) +98
   Ivy.WebLib.CreateMenu.CreateSubMenu() in d:\Websites\APC\App_Code\Ivy.WebLib.cs:180
   Ivy.WebLib.CreateMenu.GetMenu() in d:\Websites\APC\App_Code\Ivy.WebLib.cs:123
   en_us_mpgUS.Page_Load(Object sender, EventArgs e) in d:\Websites\APC\en-us\mpgUS.master.cs:39
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Control.LoadRecursive() +185
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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