XPathItem.ValueAs Method (Type)
.NET Framework 4
Returns the item's value as the specified type.
Assembly: System.Xml (in System.Xml.dll)
Parameters
- returnType
- Type: System.Type
The type to return the item value as.
| Exception | Condition |
|---|---|
| FormatException |
The item's value is not in the correct format for the target type. |
| InvalidCastException |
The attempted cast is not valid. |
| OverflowException |
The attempted cast resulted in an overflow. |
When overridden in a derived class, the ValueAs method attempts to convert the value of the item to the .NET Framework version 2.0 type specified.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.