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 38:                 EncWeb.IdRegion = Integer.Parse(.Item("idRegion"))
Line 39:                 ClimaListado.UrlLocalidad = urlLocalidad
Line 40:                 ClimaListado.CodigoClimaLocalidad = .Item("codigoClimaLocalidad")
Line 41:                 'VerMapa.MapaLatitud = Convert.ToDouble(.Item("LongitudMapa").ToString.Replace(".", ","))
Line 42:                 'VerMapa.MapaLongitud = Convert.ToDouble(.Item("LatitudMapa").ToString.Replace(".", ","))

Source File: C:\inetpub\wwwroot\guiadecabanias.com\alojamientos\listado.aspx.vb    Line: 40

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +1033
   _Listado.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\guiadecabanias.com\alojamientos\listado.aspx.vb:40
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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