“/”应用程序中的服务器错误。

Sequence contains no elements

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: Sequence contains no elements

源错误:


行 19:         {
行 20:             nid = ConvertHelper.GetInteger(Request.QueryString["nid"]);
行 21:             ns = dl.prodlist.First(a => a.Id == nid);
行 22:             tid = ns.Mid;
行 23:             operate.AddProdHits(nid, ns.Hits);

源文件: c:\wwwroot\www.cui1000.com\wwwroot\feicui\detail.aspx.cs    行: 21

堆栈跟踪:


[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) +847
   System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +113
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +344
   System.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute(Expression expression) +49
   System.Linq.Queryable.First(IQueryable`1 source, Expression`1 predicate) +301
   feicui_detail.Page_Load(Object sender, EventArgs e) in c:\wwwroot\www.cui1000.com\wwwroot\feicui\detail.aspx.cs:21
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


版本信息: Microsoft .NET Framework 版本:2.0.50727.9174; ASP.NET 版本:2.0.50727.9175