TypeConverter.ConvertFromInvariantString Method (String)
.NET Framework 4
Converts the given string to the type of this converter, using the invariant culture.
Assembly: System (in System.dll)
Parameters
- text
- Type: System.String
The String to convert.
| Exception | Condition |
|---|---|
| NotSupportedException |
The conversion cannot be performed. |
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.
Throws general Exception when string is not in correct format
When calling this method with an incorrect format (i.e. converter.ConvertFromInvariantString("ERROR") the method throws a general Exception instance with a FormatException as the InnerException property. I would expect that it would throw either NotSupportedException or FormatException (directly rather than wrapping this).
- 2/17/2011
- Owen