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 23:             {
Line 24:                 string thecode = Request.QueryString["c"];
Line 25:                 _oCont = PageContext.ContenutiGenericis.Where(kk => kk.CONTEN_Codice == thecode).Single();   
Line 26:             }
Line 27:             return _oCont;

Source File: c:\inetpub\Effecinque\www.claudiobisio.it\GC.aspx.cs    Line: 25

Stack Trace:


[InvalidOperationException: Sequence contains no elements]
   System.Linq.Enumerable.Single(IEnumerable`1 source) +317
   GC.get_oCont() in c:\inetpub\Effecinque\www.claudiobisio.it\GC.aspx.cs:25
   ASP.gc_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\Effecinque\www.claudiobisio.it\GC.aspx:8
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   ASP.default_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\Effecinque\www.claudiobisio.it\default.master:41
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   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.4700.0