Click or drag to resize
ConvertToInt16 Method (Object)
Converts the value of the specified object to a 16-bit signed integer.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static short ToInt16(
	Object value
)

Parameters

value
Type: SystemObject
An object that implements the IConvertible interface, or null.

Return Value

Type: Int16
A 16-bit signed integer that is equivalent to value, or zero if value is null.
Exceptions
ExceptionCondition
FormatExceptionvalue is not in an appropriate format for an Int16 type.
InvalidCastExceptionvalue does not implement the IConvertible interface. -or-The conversion is not supported.
OverflowExceptionvalue represents a number that is less than MinValue or greater than MaxValue.
See Also