NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Convert.ToInt16 (String, Int32)

Converts a specified String to an Int16 in the specified base.

[Visual Basic]
Overloads Public Shared Function ToInt16( _
   ByVal value As String, _
   ByVal fromBase As Integer _
) As Short
[C#]
public static short ToInt16(
   string value,
   int fromBase
);
[C++]
public: static short ToInt16(
   String* value,
   int fromBase
);
[JScript]
public static function ToInt16(
   value : String,
   fromBase : int
) : Int16;

Parameters

value
The String to be parsed.
fromBase
The base in which to parse value.

Return Value

The Int16 representation of value as a base base number .

Exceptions

Exception Type Condition
ArgumentException fromBase is not 2, 8, 10, or 16.
FormatException value cannot be parsed as a base fromBase number.
ArgumentNullException value is null.
OverflowException The value represented by value is greater than Int16.MaxValue or less than Int16.MinValue.

Remarks

If fromBase is 16, the number may be preceded by "0x"; any other leading or trailing characters cause an error.

See Also

Convert Class | Convert Members | System Namespace | Convert.ToInt16 Overload List