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 55:         tblProduct pro = db.tblProducts.Single(n => n.Language == Profile.Culture && n.ProductID == GetID_News(productid).ToString());
Line 56: 
Line 57:         tblCat1 cat1 = db.tblCat1s.Single(m => m.Cat1ID == pro.Cat1ID && m.Language == Profile.Culture);
Line 58:         string str = "";
Line 59:         

Source File: c:\inetpub\vhosts\daihoangtan.com\duchesukien.com\Products\ProductDetail.aspx.cs    Line: 57

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) +3266
   System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +189
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +428
   System.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute(Expression expression) +51
   Products_ProductDetail.GetProductIPAD() in c:\inetpub\vhosts\daihoangtan.com\duchesukien.com\Products\ProductDetail.aspx.cs:57
   ASP.products_productdetail_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\vhosts\daihoangtan.com\duchesukien.com\Products\ProductDetail.aspx:111
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   ASP.masterpage_master.__Renderform1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\vhosts\daihoangtan.com\duchesukien.com\masterpage.master:461
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11661639
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
   System.Web.UI.Adapters.ControlAdapter.Render(HtmlTextWriter writer) +24
   FormRewriterControlAdapter.Render(HtmlTextWriter writer) in c:\inetpub\vhosts\daihoangtan.com\duchesukien.com\app_code\formrewritercontroladapter.cs:20
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +116
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +53
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +169
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239


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