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 14: 
Line 15:     var data = db.QuerySingle("SELECT * FROM Articles WHERE title =@0", article);
Line 16:     var author = db.QuerySingle("SELECT FirstName, LastName, UserID, Image, ShortProfile, Profile FROM UserProfile WHERE UserID =@0", data.Author);
Line 17: 
Line 18:     var newslist = db.Query("SELECT TOP 7 ID, Title, Image, Date, Author FROM Articles WHERE Live = 'Yes' AND ID <> @0 ORDER BY Date Desc", data.ID);

Source File: d:\Websites\ukanimenet\www\Articles.cshtml    Line: 16

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object ) +148
   ASP._Page_Articles_cshtml.Execute() in d:\Websites\ukanimenet\www\Articles.cshtml:16
   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