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 89:             rdr = myCommand.ExecuteReader(CommandBehavior.Default)
Line 90:             While rdr.Read
Line 91:                 mybody = rdr.Item("ContBody")
Line 92:                 mybody = Replace(mybody, Chr(13), "<br />")
Line 93:                 mydate = rdr.Item("Contdate")

Source File: G:\PleskVhosts\leadingedgesys.com\httpdocs\NewsPosting.Aspx.vb    Line: 91

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +452708
   NewsPosting.Page_Init(Object sender, EventArgs e) in G:\PleskVhosts\leadingedgesys.com\httpdocs\NewsPosting.Aspx.vb:91
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.Page.OnInit(EventArgs e) +12
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062