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 44:                 cell = New TableCell
Line 45:                 Dim d As New Date
Line 46:                 d = Mfunc.replaceback(Trim(ds.Tables(0).Rows(j).Item("Date")))
Line 47:                 cell.Text = d.Day.ToString() & "/" & d.Month.ToString() & "/" & d.Year.ToString()
Line 48:                 tblR.Cells.Add(cell)

Source File: D:\sites\shoreshForums\forums.aspx.vb    Line: 46

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +443907
   forums.Page_Load(Object sender, EventArgs e) in D:\sites\shoreshForums\forums.aspx.vb:46
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8806; ASP.NET Version:2.0.50727.8762