See Also: Convert Members
The following table shows conversions from source types to destination types. The first column contains the source types. The remaining columns indicate the destination types the source can be converted to. An 'x' indicates the Convert class implements the conversion.
| Type | Bool | Byte | Char | DT | Dec | Dou | I16 | I32 | I64 | SBy | Sin | Str | UI16 | UI32 | UI64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Boolean | x | x | x | x | x | x | x | x | x | x | x | x | x | ||
| Byte | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| Char | x | x | x | x | x | x | x | x | x | x | |||||
| DateTime | x | x | |||||||||||||
| Decimal | x | x | x | x | x | x | x | x | x | x | x | x | x | ||
| Double | x | x | x | x | x | x | x | x | x | x | x | x | x | ||
| Int16 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| Int32 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| Int64 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| SByte | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| Single | x | x | x | x | x | x | x | x | x | x | x | x | x | ||
| String | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
| UInt16 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| UInt32 | x | x | x | x | x | x | x | x | x | x | x | x | x | x | |
| UInt64 | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
If the conversion of a numeric type results in a loss of precision, no exception is thrown. However, an exception is thrown if the conversion result is a value that is larger than that which can be represented by the destination type. For example, when a double is converted to a float, a loss of precision might occur but no exception is thrown. However, if the magnitude of the double is too large to be represented by a float, a OverflowException is thrown.