Server Error in '/' Application.

Object variable or With block variable not set.

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.NullReferenceException: Object variable or With block variable not set.

Source Error:


Line 13:     Dim selectQuery As String = "SELECT * FROM Event WHERE Active = 1 And EventId = " & Request.QueryString("ID")
Line 14:     Dim eventitem = db.QuerySingle(selectQuery)
Line 15:     Dim ContactEmail = db.QueryValue("SELECT Email From UserProfile Where UserId = " & eventitem.UserID)
Line 16: 
Line 17: 

Source File: d:\web\localuser\songpilot.dk\sponsorloeb\Participant.vbhtml    Line: 15

Stack Trace:


[NullReferenceException: Object variable or With block variable not set.]
   Microsoft.VisualBasic.CompilerServices.Container..ctor(Object Instance) +162
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +143
   ASP._Page_Participant_vbhtml.Execute() in d:\web\localuser\songpilot.dk\sponsorloeb\Participant.vbhtml:15
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +131
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +116


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