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 6:      var mID=nID.Right(nID.Length-1);
Line 7:      var Title=db.QueryValue("select newsTitle from nmg_news where Id=@0",mID);
Line 8:      Title=Title.Replace(" ","-");
Line 9:                         Title=Title.Replace(".","");
Line 10:                        Title=Title.Replace(":","");

Source File: c:\inetpub\Host\mazandnume.com\www\rcLayouts\_rcMazandnume-01.cshtml    Line: 8

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object , String , String ) +230
   System.Dynamic.UpdateDelegates.UpdateAndExecute3(CallSite site, T0 arg0, T1 arg1, T2 arg2) +265
   ASP._Page_rcLayouts__rcMazandnume_01_cshtml.Execute() in c:\inetpub\Host\mazandnume.com\www\rcLayouts\_rcMazandnume-01.cshtml:8
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +99
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +185
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +327
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +123
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +88
   System.Web.WebPages.WebPageBase.PopContext() +349
   System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase httpContext) +142


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