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 86: 
Line 87:     Private Function getProductID(ByVal db As Product_MainDataContext, ByVal ProductLookupID As Integer) As Guid
Line 88:         Return (From p In db.Products Where p.LookupID = ProductLookupID Select p.ProductID).Single
Line 89:     End Function
Line 90: 

Source File: \\fs6-n01\stor0wc2dfw1\443490\791262\www.harboursmarine.com\web\content\ProductDetails.aspx.vb    Line: 88

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) +1168
   System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +118
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +342
   System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +29
   System.Linq.Queryable.Single(IQueryable`1 source) +152
   ProductDetails.getProductID(Product_MainDataContext db, Int32 ProductLookupID) in \\fs6-n01\stor0wc2dfw1\443490\791262\www.harboursmarine.com\web\content\ProductDetails.aspx.vb:88
   ProductDetails.Page_Load(Object sender, EventArgs e) in \\fs6-n01\stor0wc2dfw1\443490\791262\www.harboursmarine.com\web\content\ProductDetails.aspx.vb:50
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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