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 17:         using (BroadwoodDBEntities myEntities = new BroadwoodDBEntities())		        // initialise the EventDetails View as a Entity
Line 18:         {
Line 19:             var eventDetails = (from thisEvent in myEntities.vw_EventDetails
Line 20:                                 where thisEvent.EventId == eventId
Line 21:                                 select thisEvent).Single();

Source File: \\hp3-winc3-smb1.hostingp3.local\domainsx\570\3684570\user\htdocs\EventDetails.aspx.cs    Line: 19

Stack Trace:


[InvalidOperationException: Sequence contains no elements]
   System.Linq.Enumerable.Single(IEnumerable`1 source) +320
   System.Data.Objects.ELinq.<>c__11`1.<GetElementFunction>b__11_3(IEnumerable`1 sequence) +43
   System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle(IEnumerable`1 query, Expression queryRoot) +61
   System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) +134
   System.Linq.Queryable.Single(IQueryable`1 source) +220
   EventDetails.Page_Load(Object sender, EventArgs e) in \\hp3-winc3-smb1.hostingp3.local\domainsx\570\3684570\user\htdocs\EventDetails.aspx.cs:19
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


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