asp.net.ph

Convert.ChangeType Method ( Object, TypeCode, IFormatProvider )

System Namespace   Convert Class


Returns an Object with the specified TypeCode and whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information.

[ VB ]
Overloads Public Shared Function ChangeType ( _
   ByVal value As Object, _
   ByVal typeCode As TypeCode, _
   ByVal provider As IFormatProvider _
) As Object

[ C# ]
public static object ChangeType (
   object value,
   TypeCode typeCode,
   IFormatProvider provider
);

[ C++ ]
public: static Object* ChangeType (
   Object* value,
   TypeCode typeCode,
   IFormatProvider* provider
);

[ JScript ]
public static function ChangeType (
   value : Object,
   typeCode : TypeCode,
   provider : IFormatProvider
) : Object;

Parameters

value
An Object that implements the IConvertible interface.
typeCode
A TypeCode.
provider
An IFormatProvider interface implementation that supplies culture-specific formatting information.

Return Value

An object whose underlying TypeCode is typeCode and whose value is equivalent to value.

-or-

A null reference ( Nothing in Visual Basic ) if value is a null reference ( Nothing ) and typeCode is TypeCode.Empty.

Exceptions


Exception Type Condition
InvalidCastException value does not implement IConvertible.
ArgumentException typeCode is invalid.

Remarks

provider enables the user to specify culture-specific conversion information about the contents of value. For example, if value is a String that represents a number, provider could supply culture-specific information about the notation used to represent that number.

See Also

Convert Members   Convert.ChangeType Overload List 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