asp.net.ph

Convert Class

System Namespace


Converts base data types to other base data types.

Convert Class Members

Collapse   Fields

Visibility Name Type
public static DBNull Object

Collapse   Methods

Visibility Name Parameters Return Type
public static ChangeType ( Object value , TypeCode typeCode ) Object
public static ChangeType ( Object value , Type conversionType ) Object
public static ChangeType ( Object value , TypeCode typeCode , IFormatProvider provider ) Object
public static ChangeType ( Object value , Type conversionType , IFormatProvider provider ) Object
public static FromBase64CharArray ( Char inArray , Int32 offset , Int32 length ) Byte
public static FromBase64String ( String s ) Byte
public static GetTypeCode ( Object value ) TypeCode
public static IsDBNull ( Object value ) Boolean
public static ToBase64CharArray ( Byte inArray , Int32 offsetIn , Int32 length , Char outArray , Int32 offsetOut ) Int32
public static ToBase64CharArray ( Byte inArray , Int32 offsetIn , Int32 length , Char outArray , Int32 offsetOut , Base64FormattingOptions options ) Int32
public static ToBase64String ( Byte inArray , Base64FormattingOptions options ) String
public static ToBase64String ( Byte inArray ) String
public static ToBase64String ( Byte inArray , Int32 offset , Int32 length , Base64FormattingOptions options ) String
public static ToBase64String ( Byte inArray , Int32 offset , Int32 length ) String
public static ToBoolean ( Double value ) Boolean
public static ToBoolean ( Single value ) Boolean
public static ToBoolean ( Decimal value ) Boolean
public static ToBoolean ( Object value ) Boolean
public static ToBoolean ( DateTime value ) Boolean
public static ToBoolean ( String value , IFormatProvider provider ) Boolean
public static ToBoolean ( Char value ) Boolean
public static ToBoolean ( Byte value ) Boolean
public static ToBoolean ( Int16 value ) Boolean
public static ToBoolean ( Object value , IFormatProvider provider ) Boolean
public static ToBoolean ( Boolean value ) Boolean
public static ToBoolean ( SByte value ) Boolean
public static ToBoolean ( UInt16 value ) Boolean
public static ToBoolean ( Int64 value ) Boolean
public static ToBoolean ( UInt64 value ) Boolean
public static ToBoolean ( UInt32 value ) Boolean
public static ToBoolean ( String value ) Boolean
public static ToBoolean ( Int32 value ) Boolean
public static ToByte ( Boolean value ) Byte
public static ToByte ( Byte value ) Byte
public static ToByte ( Char value ) Byte
public static ToByte ( String value , Int32 fromBase ) Byte
public static ToByte ( Object value ) Byte
public static ToByte ( Object value , IFormatProvider provider ) Byte
public static ToByte ( Decimal value ) Byte
public static ToByte ( Double value ) Byte
public static ToByte ( Single value ) Byte
public static ToByte ( DateTime value ) Byte
public static ToByte ( String value , IFormatProvider provider ) Byte
public static ToByte ( String value ) Byte
public static ToByte ( UInt64 value ) Byte
public static ToByte ( UInt16 value ) Byte
public static ToByte ( Int16 value ) Byte
public static ToByte ( SByte value ) Byte
public static ToByte ( Int64 value ) Byte
public static ToByte ( UInt32 value ) Byte
public static ToByte ( Int32 value ) Byte
public static ToChar ( UInt64 value ) Char
public static ToChar ( Int64 value ) Char
public static ToChar ( UInt32 value ) Char
public static ToChar ( Single value ) Char
public static ToChar ( String value , IFormatProvider provider ) Char
public static ToChar ( String value ) Char
public static ToChar ( UInt16 value ) Char
public static ToChar ( Char value ) Char
public static ToChar ( Boolean value ) Char
public static ToChar ( Object value , IFormatProvider provider ) Char
public static ToChar ( Int16 value ) Char
public static ToChar ( Byte value ) Char
public static ToChar ( SByte value ) Char
public static ToChar ( Int32 value ) Char
public static ToChar ( Object value ) Char
public static ToChar ( DateTime value ) Char
public static ToChar ( Decimal value ) Char
public static ToChar ( Double value ) Char
public static ToDateTime ( Int64 value ) DateTime
public static ToDateTime ( SByte value ) DateTime
public static ToDateTime ( DateTime value ) DateTime
public static ToDateTime ( Object value ) DateTime
public static ToDateTime ( UInt32 value ) DateTime
public static ToDateTime ( Int16 value ) DateTime
public static ToDateTime ( Byte value ) DateTime
public static ToDateTime ( Int32 value ) DateTime
public static ToDateTime ( UInt16 value ) DateTime
public static ToDateTime ( Double value ) DateTime
public static ToDateTime ( Single value ) DateTime
public static ToDateTime ( String value ) DateTime
public static ToDateTime ( Decimal value ) DateTime
public static ToDateTime ( Char value ) DateTime
public static ToDateTime ( String value , IFormatProvider provider ) DateTime
public static ToDateTime ( Object value , IFormatProvider provider ) DateTime
public static ToDateTime ( Boolean value ) DateTime
public static ToDateTime ( UInt64 value ) DateTime
public static ToDecimal ( Single value ) Decimal
public static ToDecimal ( Object value ) Decimal
public static ToDecimal ( SByte value ) Decimal
public static ToDecimal ( Object value , IFormatProvider provider ) Decimal
public static ToDecimal ( UInt16 value ) Decimal
public static ToDecimal ( Int16 value ) Decimal
public static ToDecimal ( Char value ) Decimal
public static ToDecimal ( Int32 value ) Decimal
public static ToDecimal ( UInt64 value ) Decimal
public static ToDecimal ( Int64 value ) Decimal
public static ToDecimal ( UInt32 value ) Decimal
public static ToDecimal ( Decimal value ) Decimal
public static ToDecimal ( Boolean value ) Decimal
public static ToDecimal ( DateTime value ) Decimal
public static ToDecimal ( String value , IFormatProvider provider ) Decimal
public static ToDecimal ( Byte value ) Decimal
public static ToDecimal ( Double value ) Decimal
public static ToDecimal ( String value ) Decimal
public static ToDouble ( SByte value ) Double
public static ToDouble ( UInt16 value ) Double
public static ToDouble ( Char value ) Double
public static ToDouble ( UInt32 value ) Double
public static ToDouble ( Int32 value ) Double
public static ToDouble ( Object value , IFormatProvider provider ) Double
public static ToDouble ( Byte value ) Double
public static ToDouble ( Int16 value ) Double
public static ToDouble ( Object value ) Double
public static ToDouble ( Int64 value ) Double
public static ToDouble ( String value , IFormatProvider provider ) Double
public static ToDouble ( String value ) Double
public static ToDouble ( DateTime value ) Double
public static ToDouble ( Boolean value ) Double
public static ToDouble ( Single value ) Double
public static ToDouble ( UInt64 value ) Double
public static ToDouble ( Decimal value ) Double
public static ToDouble ( Double value ) Double
public static ToInt16 ( Int64 value ) Int16
public static ToInt16 ( UInt64 value ) Int16
public static ToInt16 ( Int16 value ) Int16
public static ToInt16 ( Int32 value ) Int16
public static ToInt16 ( UInt32 value ) Int16
public static ToInt16 ( DateTime value ) Int16
public static ToInt16 ( String value , IFormatProvider provider ) Int16
public static ToInt16 ( Decimal value ) Int16
public static ToInt16 ( Single value ) Int16
public static ToInt16 ( Double value ) Int16
public static ToInt16 ( Object value ) Int16
public static ToInt16 ( Object value , IFormatProvider provider ) Int16
public static ToInt16 ( String value ) Int16
public static ToInt16 ( String value , Int32 fromBase ) Int16
public static ToInt16 ( Boolean value ) Int16
public static ToInt16 ( Byte value ) Int16
public static ToInt16 ( UInt16 value ) Int16
public static ToInt16 ( Char value ) Int16
public static ToInt16 ( SByte value ) Int16
public static ToInt32 ( String value , Int32 fromBase ) Int32
public static ToInt32 ( Int32 value ) Int32
public static ToInt32 ( String value ) Int32
public static ToInt32 ( Decimal value ) Int32
public static ToInt32 ( DateTime value ) Int32
public static ToInt32 ( String value , IFormatProvider provider ) Int32
public static ToInt32 ( UInt64 value ) Int32
public static ToInt32 ( Int64 value ) Int32
public static ToInt32 ( Double value ) Int32
public static ToInt32 ( Single value ) Int32
public static ToInt32 ( UInt32 value ) Int32
public static ToInt32 ( Boolean value ) Int32
public static ToInt32 ( Char value ) Int32
public static ToInt32 ( Object value ) Int32
public static ToInt32 ( Object value , IFormatProvider provider ) Int32
public static ToInt32 ( Int16 value ) Int32
public static ToInt32 ( UInt16 value ) Int32
public static ToInt32 ( SByte value ) Int32
public static ToInt32 ( Byte value ) Int32
public static ToInt64 ( DateTime value ) Int64
public static ToInt64 ( String value , IFormatProvider provider ) Int64
public static ToInt64 ( String value , Int32 fromBase ) Int64
public static ToInt64 ( SByte value ) Int64
public static ToInt64 ( String value ) Int64
public static ToInt64 ( Boolean value ) Int64
public static ToInt64 ( Char value ) Int64
public static ToInt64 ( Byte value ) Int64
public static ToInt64 ( Single value ) Int64
public static ToInt64 ( Object value ) Int64
public static ToInt64 ( Object value , IFormatProvider provider ) Int64
public static ToInt64 ( UInt32 value ) Int64
public static ToInt64 ( UInt64 value ) Int64
public static ToInt64 ( Int64 value ) Int64
public static ToInt64 ( Int16 value ) Int64
public static ToInt64 ( UInt16 value ) Int64
public static ToInt64 ( Int32 value ) Int64
public static ToInt64 ( Decimal value ) Int64
public static ToInt64 ( Double value ) Int64
public static ToSByte ( Byte value ) SByte
public static ToSByte ( Char value ) SByte
public static ToSByte ( UInt16 value ) SByte
public static ToSByte ( Int16 value ) SByte
public static ToSByte ( Object value , IFormatProvider provider ) SByte
public static ToSByte ( Decimal value ) SByte
public static ToSByte ( SByte value ) SByte
public static ToSByte ( Boolean value ) SByte
public static ToSByte ( Int32 value ) SByte
public static ToSByte ( Double value ) SByte
public static ToSByte ( Int64 value ) SByte
public static ToSByte ( Single value ) SByte
public static ToSByte ( String value , Int32 fromBase ) SByte
public static ToSByte ( UInt64 value ) SByte
public static ToSByte ( Object value ) SByte
public static ToSByte ( UInt32 value ) SByte
public static ToSByte ( DateTime value ) SByte
public static ToSByte ( String value ) SByte
public static ToSByte ( String value , IFormatProvider provider ) SByte
public static ToSingle ( UInt16 value ) Single
public static ToSingle ( Int16 value ) Single
public static ToSingle ( UInt32 value ) Single
public static ToSingle ( Int32 value ) Single
public static ToSingle ( Char value ) Single
public static ToSingle ( Object value , IFormatProvider provider ) Single
public static ToSingle ( Object value ) Single
public static ToSingle ( Byte value ) Single
public static ToSingle ( SByte value ) Single
public static ToSingle ( String value , IFormatProvider provider ) Single
public static ToSingle ( Boolean value ) Single
public static ToSingle ( Decimal value ) Single
public static ToSingle ( String value ) Single
public static ToSingle ( DateTime value ) Single
public static ToSingle ( UInt64 value ) Single
public static ToSingle ( Int64 value ) Single
public static ToSingle ( Double value ) Single
public static ToSingle ( Single value ) Single
public static ToString ( UInt16 value , IFormatProvider provider ) String
public static ToString ( UInt16 value ) String
public static ToString ( Int16 value ) String
public static ToString ( Int16 value , IFormatProvider provider ) String
public static ToString ( UInt32 value ) String
public static ToString ( UInt32 value , IFormatProvider provider ) String
public static ToString ( Int32 value ) String
public static ToString ( Int32 value , IFormatProvider provider ) String
public static ToString ( Byte value , IFormatProvider provider ) String
public static ToString ( Boolean value ) String
public static ToString ( Boolean value , IFormatProvider provider ) String
public static ToString ( Object value ) String
public static ToString ( Object value , IFormatProvider provider ) String
public static ToString ( Char value ) String
public static ToString ( SByte value , IFormatProvider provider ) String
public static ToString ( Byte value ) String
public static ToString ( Char value , IFormatProvider provider ) String
public static ToString ( SByte value ) String
public static ToString ( DateTime value , IFormatProvider provider ) String
public static ToString ( String value ) String
public static ToString ( Decimal value , IFormatProvider provider ) String
public static ToString ( DateTime value ) String
public static ToString ( String value , IFormatProvider provider ) String
public static ToString ( Int32 value , Int32 toBase ) String
public static ToString ( Int64 value , Int32 toBase ) String
public static ToString ( Byte value , Int32 toBase ) String
public static ToString ( Int16 value , Int32 toBase ) String
public static ToString ( UInt64 value ) String
public static ToString ( UInt64 value , IFormatProvider provider ) String
public static ToString ( Int64 value ) String
public static ToString ( Int64 value , IFormatProvider provider ) String
public static ToString ( Single value ) String
public static ToString ( Decimal value ) String
public static ToString ( Double value , IFormatProvider provider ) String
public static ToString ( Double value ) String
public static ToString ( Single value , IFormatProvider provider ) String
public static ToUInt16 ( String value , Int32 fromBase ) UInt16
public static ToUInt16 ( Decimal value ) UInt16
public static ToUInt16 ( UInt32 value ) UInt16
public static ToUInt16 ( Int64 value ) UInt16
public static ToUInt16 ( UInt16 value ) UInt16
public static ToUInt16 ( Int16 value ) UInt16
public static ToUInt16 ( Int32 value ) UInt16
public static ToUInt16 ( String value ) UInt16
public static ToUInt16 ( String value , IFormatProvider provider ) UInt16
public static ToUInt16 ( Double value ) UInt16
public static ToUInt16 ( UInt64 value ) UInt16
public static ToUInt16 ( Single value ) UInt16
public static ToUInt16 ( Byte value ) UInt16
public static ToUInt16 ( Object value , IFormatProvider provider ) UInt16
public static ToUInt16 ( Object value ) UInt16
public static ToUInt16 ( DateTime value ) UInt16
public static ToUInt16 ( SByte value ) UInt16
public static ToUInt16 ( Char value ) UInt16
public static ToUInt16 ( Boolean value ) UInt16
public static ToUInt32 ( Single value ) UInt32
public static ToUInt32 ( UInt64 value ) UInt32
public static ToUInt32 ( Int64 value ) UInt32
public static ToUInt32 ( UInt16 value ) UInt32
public static ToUInt32 ( Int32 value ) UInt32
public static ToUInt32 ( UInt32 value ) UInt32
public static ToUInt32 ( String value ) UInt32
public static ToUInt32 ( String value , IFormatProvider provider ) UInt32
public static ToUInt32 ( String value , Int32 fromBase ) UInt32
public static ToUInt32 ( Double value ) UInt32
public static ToUInt32 ( DateTime value ) UInt32
public static ToUInt32 ( Decimal value ) UInt32
public static ToUInt32 ( Object value , IFormatProvider provider ) UInt32
public static ToUInt32 ( Boolean value ) UInt32
public static ToUInt32 ( Byte value ) UInt32
public static ToUInt32 ( Object value ) UInt32
public static ToUInt32 ( Int16 value ) UInt32
public static ToUInt32 ( SByte value ) UInt32
public static ToUInt32 ( Char value ) UInt32
public static ToUInt64 ( String value ) UInt64
public static ToUInt64 ( Object value , IFormatProvider provider ) UInt64
public static ToUInt64 ( Object value ) UInt64
public static ToUInt64 ( Boolean value ) UInt64
public static ToUInt64 ( SByte value ) UInt64
public static ToUInt64 ( Char value ) UInt64
public static ToUInt64 ( Int16 value ) UInt64
public static ToUInt64 ( Byte value ) UInt64
public static ToUInt64 ( DateTime value ) UInt64
public static ToUInt64 ( Decimal value ) UInt64
public static ToUInt64 ( String value , IFormatProvider provider ) UInt64
public static ToUInt64 ( Double value ) UInt64
public static ToUInt64 ( Single value ) UInt64
public static ToUInt64 ( UInt64 value ) UInt64
public static ToUInt64 ( UInt16 value ) UInt64
public static ToUInt64 ( String value , Int32 fromBase ) UInt64
public static ToUInt64 ( Int32 value ) UInt64
public static ToUInt64 ( Int64 value ) UInt64
public static ToUInt64 ( UInt32 value ) UInt64

Remarks

This class returns a base type that is equivalent to the value of a specified type.

Conversions are supported to and from Byte, SByte, Int16, Int32, Int64, UInt16, UInt32, UInt64, Single, Double, Decimal, String, and Object.

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

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

Conversions of DateTime are supported to and from String.

An exception will not be thrown if the conversion of a numeric type results in a loss of precision ( that is, the loss of some least significant digits ). However, an exception will be thrown if the result is larger than can be represented by the particular conversion method's return value type.

For example, when a Double is converted to a Single, a loss of precision may occur but no exception is thrown. However, if the magnitude of the Double is too large to be represented by a Single, an overflow exception is thrown.

A set of methods support converting an array of bytes to and from a String or array of Unicode characters consisting of base 64 digit characters. Data expressed as base 64 digits can be easily conveyed over data channels that can only transmit 7-bit characters.

Many of the methods in this class convert a source type to a target type by invoking the corresponding IConvertible explicit interface implementation method on the source object. If such a method does not exist, an InvalidCastException is thrown.

Some of the methods in this class take a parameter object that implements the IFormatProvider interface. This parameter can supply culture-specific formatting information to assist the conversion process. The base value types ignore this parameter, but any user-defined type that implements IConvertible can honor it.

For more information about the base value types, see the appropriate topic listed in the See Also section.

See Also

Object   SByte   Int16   Int32   Int64   Byte   UInt16   UInt32   UInt64   Single   Double   Decimal   Boolean   Char   String Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph