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 23:         drCalendario = DatiCalendario(cn, IdCalendario)
Line 24:         If IsNothing(drCalendario) Then Exit Sub
Line 25:         litTesto.Text = drCalendario("Testo")
Line 26: 
Line 27:         Dim cmd As New OleDb.OleDbCommand("Select * from MarcatoriVista where IdCalendario=" & drCalendario("Id") & " order by Numero,NumeroIns, Nome", cn)

Source File: D:\clienti\candriai\www.trentinofutsal.it\Tabellino.aspx.vb    Line: 25

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +1287685
   Tabellino.inizializza() in D:\clienti\candriai\www.trentinofutsal.it\Tabellino.aspx.vb:25
   Tabellino.Page_Load(Object sender, EventArgs e) in D:\clienti\candriai\www.trentinofutsal.it\Tabellino.aspx.vb:14
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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