Server Error in '/' Application.

Cannot perform runtime binding on a null reference

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: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference

Source Error:


Line 34:     var latest = db.Query("SELECT TOP 15 Title, Date, Image, ImagePromo, Author FROM Other WHERE Category='2' AND Live ='Yes' ORDER BY Date Desc");
Line 35:     var toparticle = db.QuerySingle("SELECT TOP 1 Title, Date, BannerImage, Score, Author, BannerSwitch FROM Other WHERE Category='2' AND BannerSwitch = 'y' ORDER BY Date DESC");
Line 36:     var topauthor = db.QuerySingle("SELECT FirstName, LastName FROM UserProfile WHERE UserID =@0", toparticle.Author);
Line 37: 
Line 38: }

Source File: d:\Websites\ukanimenet\www\Hub-Toybox.cshtml    Line: 36

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object ) +148
   ASP._Page_Hub_Toybox_cshtml.Execute() in d:\Websites\ukanimenet\www\Hub-Toybox.cshtml:36
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +182
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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