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 291:	While RsFoto.Read()
Line 292:
Line 293:     NFNEW = CODICECHIESA & "-" & FotoNumero & "-" & [LOCALITA] & "-" & Left(NChiesa(j),25) & "-" & Left(RsFoto("DES"),20)
Line 294:     NFNEW = Replace(NFNEW, " ", "-")
Line 295:	 NFNEW = Replace(NFNEW, "'", "-")

Source File: C:\inetpub\wwwroot\chieseromaniche\Chiese-Romaniche-Gotiche-Piemonte-Presenta-Chiese.htm    Line: 293

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +1113
   ASP.chiese_romaniche_gotiche_piemonte_presenta_chiese_htm.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in C:\inetpub\wwwroot\chieseromaniche\Chiese-Romaniche-Gotiche-Piemonte-Presenta-Chiese.htm:293
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +276
   System.Web.UI.Page.Render(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4239


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