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 53:     public static DataTable GetPostsForDisplayFwf(int forumid)
Line 54:     {
Line 55:         DataTable dt = GetLatestFwf(forumid).CopyToDataTable();
Line 56:         var currentFwf = dt.Rows[0]["id"];
Line 57:         dt.Merge(ForumName.GetPosts(forumid).AsEnumerable().Where(x => x.Field<int>("id") != (int)currentFwf).CopyToDataTable());

Source File: c:\IIS\WWW\tg2021.nexustestdomain.co.uk\App_Code\ForumName.cs    Line: 55

Stack Trace:


[InvalidOperationException: The source contains no DataRows.]
   System.Data.DataTableExtensions.LoadTableFromEnumerable(IEnumerable`1 source, DataTable table, Nullable`1 options, FillErrorEventHandler errorHandler) +1095
   System.Data.DataTableExtensions.CopyToDataTable(IEnumerable`1 source) +96
   ForumName.GetPostsForDisplayFwf(Int32 forumid) in c:\IIS\WWW\tg2021.nexustestdomain.co.uk\App_Code\ForumName.cs:55
   ShowForum.Page_Load(Object sender, EventArgs e) in c:\IIS\WWW\tg2021.nexustestdomain.co.uk\ShowForum.aspx.cs:64
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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