Server Error in '/' Application.

Conversion from type 'DBNull' to type 'String' is not valid.

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.InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.

Source Error:


Line 83:                     For Each row As DataRow In dt.Rows
Line 84:                         Dim jobNode = FindSiteMapNodeFromKey(String.Format("Job:{0}", row.Item("ContentTitle")))
Line 85:                         Dim MenuItem As String = row.Item("ContentSection")
Line 86:                         Dim MasterPg As String = row.Item("ContentMasterPage")
Line 87: 

Source File: D:\InetPub\vhosts\rwheway-509.package\jml.org\wwwroot\App_Code\CustomSiteMapProvider.vb    Line: 85

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +862
   MixedSiteMapProvider.CustomSitemapProvider.BuildSiteMap() in D:\InetPub\vhosts\rwheway-509.package\jml.org\wwwroot\App_Code\CustomSiteMapProvider.vb:85
   System.Web.XmlSiteMapProvider.get_RootNode() +15
   System.Web.UI.WebControls.SiteMapDataSource.GetNodes() +234
   System.Web.UI.WebControls.SiteMapDataSource.GetTreeView(String viewPath) +36
   System.Web.UI.WebControls.SiteMapDataSource.GetHierarchicalView(String viewPath) +30
   DevExpress.Web.ASPxSiteMapDataSource.GetHierarchicalView(String viewPath) +26
   System.Web.UI.HierarchicalDataSourceControl.System.Web.UI.IHierarchicalDataSource.GetHierarchicalView(String viewPath) +9
   DevExpress.Web.Internal.HierarchicalDataHelper.GetData(String viewPath) +43
   DevExpress.Web.ASPxHierarchicalDataWebControl.GetData(String name, String viewPath) +57
   DevExpress.Web.ASPxMenuBase.DataBindItem(MenuItem item) +34
   DevExpress.Web.ASPxMenuBase.PerformDataBinding(String dataHelperName) +200
   DevExpress.Web.Internal.HierarchicalDataHelper.PerformDataBinding() +50
   DevExpress.Web.Internal.HierarchicalDataHelper.PerformSelect() +60
   DevExpress.Web.Internal.DataContainer.PerformSelect() +136
   DevExpress.Web.ASPxDataWebControlBase.DataBindCore() +13
   DevExpress.Web.ASPxDataWebControlBase.DataBindInternal() +110
   DevExpress.Web.ASPxWebControl.DataBind() +46
   System.Web.UI.Control.DataBindChildren() +181
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +163
   System.Web.UI.Control.DataBind() +15
   DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) +159
   DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) +225
   DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) +225
   DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) +225
   DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) +225
   DevExpress.Web.ASPxWebControlBase.DataBindContainers(Control parent, Boolean bindContents, Boolean bindTemplates) +225
   DevExpress.Web.ASPxWebControl.CreateChildControls() +206
   System.Web.UI.Control.EnsureChildControls() +116
   DevExpress.Web.ASPxWebControlBase.EnsureChildControls() +4
   DevExpress.Web.ASPxWebControl.AfterInit() +45
   DevExpress.Web.ASPxWebControlBase.OnInit(EventArgs e) +60
   System.Web.UI.Control.InitRecursive(Control namingContainer) +392
   System.Web.UI.Control.InitRecursive(Control namingContainer) +185
   System.Web.UI.Control.InitRecursive(Control namingContainer) +185
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1635


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