Module Example
Public Sub Main()
Dim values() As Decimal = { Decimal.MinValue, -1034.23d, Decimal.MaxValue }
Dim result As Short
For Each value As Decimal In values
Try
result = Convert.ToInt16(value)
Console.WriteLine("Converted {0} to {1}.", value, result)
Catch e As OverflowException
Console.WriteLine("{0} is outside the range of the Int16 type.",value)
End Try
Next
End Sub
End Module