Server Error in '/' Application.

There is no row at position 0.

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.IndexOutOfRangeException: There is no row at position 0.

Source Error:


Line 24:     Layout = "Layout.cshtml";
Line 25:     //will always be a result in this ds
Line 26:     Page.Canonical = System.Configuration.ConfigurationManager.AppSettings["Cgo.Site.Url"].ToString() + System.Configuration.ConfigurationManager.AppSettings["Cgo." + WhichSite + ".Path"].ToString() + ds.Tables[2].Rows[0]["Url"].ToString();
Line 27:     Boolean displayImages = false;
Line 28:     HtmlString Headline = null;

Source File: c:\Websites\SelseyWebSite22\Index.cshtml    Line: 26

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2519554
   System.Data.DataRowCollection.get_Item(Int32 index) +20
   ASP._Page_Index_cshtml.Execute() in c:\Websites\SelseyWebSite22\Index.cshtml:26
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +185
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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