asp.net.ph

Convert.ChangeType Method ( Object, Type, IFormatProvider )

System Namespace   Convert Class


Returns an Object with the specified Type 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 conversionType As Type, _
   ByVal provider As IFormatProvider _
) As Object

[ C# ]
public static object ChangeType (
   object value,
   Type conversionType,
   IFormatProvider provider
);

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

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

Parameters

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

Return Value

An object whose Type is conversionType and whose value is equivalent to value.

-or-

A null reference ( Nothing in Visual Basic ), if value and conversionType are null references ( Nothing ).

-or-

value, if the Type of value and conversionType are equal.

Exceptions


Exception Type Condition
InvalidCastException value does not implement IConvertible and conversionType is not a null reference ( Nothing in Visual Basic ) or equal to the Type of value.
ArgumentException conversionType 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