Server Error in '/' Application.

Unable to cast object of type 'System.DBNull' to type 'System.String'.

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: Unable to cast object of type 'System.DBNull' to type 'System.String'.

Source Error:


Line 46: 			
Line 47: 
Line 48:             NewsBody.InnerHtml = HtmlHelper.PrepareNewsBoby((string) dvND[0].Row["Body"]);
Line 49: 
Line 50:             if ( dvND[ 0 ].Row[ "Body" ] != DBNull.Value )

Source File: c:\inetpub\mineral.ru\WC_NewsDetails.ascx.cs    Line: 48

Stack Trace:


[InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.]
   WC_NewsDetails.Page_Load(Object sender, EventArgs e) in c:\inetpub\mineral.ru\WC_NewsDetails.ascx.cs:48
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9054; ASP.NET Version:2.0.50727.9051