Convert.ChangeType Method
Returns an object of a specified type whose value is equivalent to a specified object.
This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.
| Name | Description | |
|---|---|---|
|
ChangeType(Object, Type) | Returns an object of the specified type and whose value is equivalent to the specified object. |
|
ChangeType(Object, TypeCode) | Returns an object of the specified type whose value is equivalent to the specified object. |
|
ChangeType(Object, Type, IFormatProvider) | Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information. |
|
ChangeType(Object, TypeCode, IFormatProvider) | Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information. |
The reader must understand that Convert.ChangeType() works only for certain, standard .NET system types. It does not work for any component that does not implement IConvertible, and it does not work for custom types.
For an overview of the scope of general Type conversion, including a specific set of guidelines, principles, and web links that illustrate how to solve the problem in a broader, more useful, and generalized manner, please refer to the following link:
http://stackoverflow.com/questions/312858/how-can-i-convert-types-at-runtime/7942350#7942350
- 1/12/2012
- MJ App Factory