Server Error in '/' Application.

Object reference not set to an instance of an object.

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: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 621:	public static dynamic Single(string SQLSelect, string Token = null) {
Line 622:        var CMSDB = Database.Open("Mura");
Line 623:        var Result = CMSDB.QuerySingle(SQLSelect);
Line 624:
Line 625:        // if(Result != null && App.CMSCacheEnabled == true && Token != null) {

Source File: c:\inetpub\wwwroot\Shared\Custom\_Layout.cshtml    Line: 623

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   WebMatrix.Data.<QueryInternal>d__0.MoveNext() +172
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +121
   WebMatrix.Data.Database.QuerySingle(String commandText, Object[] args) +98
   ASP._Page_Shared_Custom__Layout_cshtml.Single(String SQLSelect, String Token) in c:\inetpub\wwwroot\Shared\Custom\_Layout.cshtml:623
   ASP._Page_Shared_Custom__Layout_cshtml.GetCMSArticle(String Title, String ParentId) in c:\inetpub\wwwroot\Shared\Custom\_Layout.cshtml:548
   ASP._Page_Shared_Custom__Layout_cshtml.CMSArticle(String ArticleName) in c:\inetpub\wwwroot\Shared\Custom\_Layout.cshtml:488
   ASP._Page_Shared_Custom__Layout_cshtml.Execute() in c:\inetpub\wwwroot\Shared\Custom\_Layout.cshtml:288
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +131
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +231
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +10
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +80
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +63
   System.Web.WebPages.WebPageBase.PopContext() +263
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +98
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +231
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +10
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +80
   CallSite.Target(Closure , CallSite , _Page_Browse_cshtml , Object ) +100
   ASP._Page_Browse_cshtml.Execute() in c:\inetpub\wwwroot\Browse.cshtml:6
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
   System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) +69
   System.Web.WebPages.WebPage.ExecutePageHierarchy() +131
   System.Web.WebPages.StartPage.RunPage() +17
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +64
   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.6.1069.1