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 25:    	testoPagina.Text = reader_pagina("testoPagina")
Line 26:    	testoPagina2.Text = reader_pagina("testoPagina2")
Line 27:    	testoPagina3.Text = reader_pagina("testoPagina3")
Line 28:    	testoPagina4.Text = reader_pagina("testoPagina4")
Line 29:    	testoPagina5.Text = reader_pagina("testoPagina5")

Source File: D:\inetpub\webs\miriabilitoit\trova-esperto.aspx    Line: 27

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +862
   ASP.trova_esperto_aspx.Page_Load(Object Src, EventArgs E) in D:\inetpub\webs\miriabilitoit\trova-esperto.aspx:27
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +85
   System.Web.UI.Control.OnLoad(EventArgs e) +79
   System.Web.UI.Control.LoadRecursive() +130
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2857


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