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 Class

Converts base data types to other base data types.

A conversion that results in a loss of precision (narrowing conversion) will not return an exception; however, an exception will be returned if the resultant magnitude is out of range. For example, when a Double is converted to a Single, a loss of precision may occur, but an exception will not be thrown. However, if the Double is too large in magnitude to be represented by a Single, an exception will be thrown.

Object
   Convert

[Visual Basic]
NotInheritable Public Class Convert
[C#]
public sealed class Convert
[C++]
public __gc __sealed class Convert
[JScript]
public class Convert

Remarks

This class supports conversions in both directions between any two of the following types: Byte, SByte, Int16, Int32, Int64, UInt16, UInt32, UInt64, Single, Double, Currency, Decimal, String, Variant, and Object.

Conversions from Char to Int32, UInt32, String, Variant, and Object are supported.

Conversions to Char from Byte, SByte, Int16, Int32, UInt16, and UInt32, String, and Variant are supported.

Conversions from Boolean to Byte, Char, Int16, Int32, Int64, UInt16, UInt32, UInt64, String, Variant, and Object are supported.

You can convert to Boolean from Byte, SByte, Int16, Int32, Int64, UInt16, UInt32, and UInt64, as well as String and Variant.

Conversions of TimeSpan and DateTime are supported to and from String and Variant.

Requirements

Namespace: System

Assembly: mscorlib.dll

See Also

Convert Members | System Namespace