XmlSchemaDatatype::ChangeType Method (Object^, Type^)

 

Converts the value specified, whose type is one of the valid Common Language Runtime (CLR) representations of the XML schema type represented by the XmlSchemaDatatype, to the CLR type specified.

Namespace:   System.Xml.Schema
Assembly:  System.Xml (in System.Xml.dll)

public:
virtual Object^ ChangeType(
	Object^ value,
	Type^ targetType
)

Parameters

value
Type: System::Object^

The input value to convert to the specified type.

targetType
Type: System::Type^

The target type to convert the input value to.

Return Value

Type: System::Object^

The converted input value.

Exception Condition
ArgumentNullException

The Object or Type parameter is null.

InvalidCastException

The type represented by the XmlSchemaDatatype does not support a conversion from type of the value specified to the type specified.

For more information about type support in the System.Xml classes and conversion of XML data types, see the Type Support in the System.Xml Classes topic.

.NET Framework
Available since 2.0
Return to top
Show: