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 21: 	PageData["Logo"] = "logo-"+Photolng+".png";
Line 22: 
Line 23:     PageData["defsite"] = db.QuerySingle("SELECT title FROM PSP_Global_Resources WHERE LANG_ID = @0 and Ref_id=1", @lng).title;
Line 24:     PageData["defhome"] = db.QuerySingle("SELECT title FROM PSP_Global_Resources WHERE LANG_ID = @0 and Ref_id=2", @lng).title;
Line 25:     PageData["defcontact"] = db.QuerySingle("SELECT title FROM PSP_Global_Resources WHERE LANG_ID = @0 and Ref_id=3", @lng).title;

Source File: c:\Sites\Prismaeyecenter\_PageStart.cshtml    Line: 23

Stack Trace:


[RuntimeBinderException: Cannot perform runtime binding on a null reference]
   CallSite.Target(Closure , CallSite , Object ) +115
   System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +257
   CallSite.Target(Closure , CallSite , Object ) +223
   ASP._Page__PageStart_cshtml.Execute() in c:\Sites\Prismaeyecenter\_PageStart.cshtml:23
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +46
   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.4690.0