InvalidDataException Constructor

InvalidDataException Constructor

 

Initializes a new instance of the InvalidDataException class.

Namespace:   System.IO
Assembly:  System (in System.dll)

NameDescription
System_CAPS_pubmethodInvalidDataException()

Initializes a new instance of the InvalidDataException class.

System_CAPS_pubmethodInvalidDataException(String)

Initializes a new instance of the InvalidDataException class with a specified error message.

System_CAPS_pubmethodInvalidDataException(String, Exception)

Initializes a new instance of the InvalidDataException class with a reference to the inner exception that is the cause of this exception.

An InvalidDataException is thrown when invalid data is detected in the data stream, such as in the following situations:

  • A row of data in a delimited text file does not have the expected number of fields.

  • An attempt is made to read a binary file, such as word processing document, that has become corrupted.

  • An attempt is made to read bytes from a decompression stream that has an invalid format.

Return to top
Show:
© 2016 Microsoft