Server Error in '/' Application.

Conversion from type 'DBNull' to type 'Short' 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 'Short' is not valid.

Source Error:


Line 342:            Settore = LiteralSettore.Text
Line 343:
Line 344:            LiteralTipologia.Text = convNull3(comune.ricavaTipologia(drw.Item("tipologia"), Request))
Line 345:            Tipologia = LiteralTipologia.Text
Line 346:            If Tipologia = "\" Then Tipologia = ""

Source File: D:\inetpub\webs\ikikoocom\equipment\list\ad.ascx.vb    Line: 344

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'Short' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToShort(Object Value) +459501
   equipment.ad.riempiSu() in D:\inetpub\webs\ikikoocom\equipment\list\ad.ascx.vb:344
   equipment.ad.Page_Load(Object sender, EventArgs e) in D:\inetpub\webs\ikikoocom\equipment\list\ad.ascx.vb:64
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.9174; ASP.NET Version:2.0.50727.9175