Server Error in '/' Application.

Sequence contains no elements

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: Sequence contains no elements

Source Error:


Line 57: 
Line 58:             //this.Title = "Printer Post - new + used " + categories.First().ToLower() + " equipment + machines + allied services business to business company news and up to date articles";
Line 59:             CategoryLabel.Text = categories.First() + " News";
Line 60:             CategoryLabel.Font.Size = 15;
Line 61:             Breadcrumb_Label.Text = Breadcrumb_Label.Text + "<li><a href='/" + CatID + "/print-packaging-screenprinting-signage-large-format-industry-news/" + HttpUtility.UrlEncode(CommonFunction.filterForFileName(categories.First().ToString().ToLower().Trim())) + ".aspx'>" + categories.First() + "</a></li>";

Source File: c:\inetpub\vhosts\printerspost.com.au\httpdocs\ArticleList.aspx.cs    Line: 59

Stack Trace:


[InvalidOperationException: Sequence contains no elements]
   System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) +2189
   System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +207
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +576
   System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +46
   System.Linq.Queryable.First(IQueryable`1 source) +352
   ArticleList.Page_Load(Object sender, EventArgs e) in c:\inetpub\vhosts\printerspost.com.au\httpdocs\ArticleList.aspx.cs:59
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975