Server Error in '/' Application.

Cannot convert null to 'int' because it is a non-nullable value type

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 convert null to 'int' because it is a non-nullable value type

Source Error:


Line 11:     if (SEOPageID.Length > 2)
Line 12:     {
Line 13:         int relink = db.QueryValue("SELECT TOP 1 ID FROM Category WHERE Title = @0 AND Live = 'Yes'", SEOPageID);
Line 14:         PageID = relink;
Line 15:     }

Source File: d:\Websites\BatemanOgden\www\Products.cshtml    Line: 13

Stack Trace:


[RuntimeBinderException: Cannot convert null to 'int' because it is a non-nullable value type]
   CallSite.Target(Closure , CallSite , Object ) +148
   System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +244
   ASP._Page_Products_cshtml.Execute() in d:\Websites\BatemanOgden\www\Products.cshtml:13
   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