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 31:             If dt.Rows.Count <> 0 Then
Line 32:                 'Me.ltlTITLE.Text = dt.Rows(0).Item("title")
Line 33:                 Me.ltlCONTENT.Text = dt.Rows(0).Item("desc1")
Line 34:                 Me.Master.Page.Title = dt.Rows(0).Item("title").ToString()
Line 35:                 Dim tag As HtmlMeta = New HtmlMeta()

Source File: C:\HQ_WEB\WEB\TteSports\global\newsdetail.aspx.vb    Line: 33

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +715831
   newsdetail.Page_Load(Object sender, EventArgs e) in C:\HQ_WEB\WEB\TteSports\global\newsdetail.aspx.vb:33
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8813; ASP.NET Version:2.0.50727.8951