FormatException Class
Collapse the table of content
Expand the table of content

FormatException Class

The exception that is thrown when the format of an argument does not meet the parameter specifications of the invoked method.

For a list of all members of this type, see FormatException Members.


[Visual Basic]
Public Class FormatException
   Inherits SystemException
public class FormatException : SystemException
public __gc class FormatException : public SystemException
class FormatException extends SystemException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


FormatException is thrown when the format of an argument in a method invocation does not match the format of the corresponding formal parameter type. For example, if a method specifies a String parameter consisting of two digits with an embedded period, passing a corresponding string argument containing only two digits to that method would cause FormatException to be thrown.

FormatException uses the HRESULT COR_E_FORMAT, which has the value 0x80131537.

For a list of initial property values for an instance of FormatException, see the FormatException constructors.


Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

FormatException Members | System Namespace | Exception | Handling and Throwing Exceptions

© 2015 Microsoft