Class CsvException
A comma-separated values file parsing error.
[Serializable]
public class CsvException : Exception, ISerializable, _Exception
- Inheritance
-
CsvException
- Implements
- Inherited Members
- Extension Methods
Constructors
CsvException()
Initializes a new instance of the CsvException class.
public CsvException()
CsvException(int, int, Exception)
Initializes a new instance of the CsvException class with a specified parameters and error exception.
public CsvException(int lineNumber, int fieldNumber, Exception exception)
Parameters
lineNumber
intThe line number in the CSV file at which the error occurred.
fieldNumber
intThe field number at which the error occurred.
exception
ExceptionThe exception that describes the error. This, prefaced with the line and field numbers (if non-zero), will make up the exception message.
CsvException(int, int, string)
Initializes a new instance of the CsvException class with a specified parameters and error message.
public CsvException(int lineNumber, int fieldNumber, string errorMessage)
Parameters
lineNumber
intThe line number in the CSV file at which the error occurred.
fieldNumber
intThe field number at which the error occurred.
errorMessage
stringThe message that describes the error. This, prefaced with the line and field numbers (if non-zero), will make up the exception message.
CsvException(int, int, string, Exception)
Initializes a new instance of the CsvException class with a specified parameters and error message.
public CsvException(int lineNumber, int fieldNumber, string errorMessage, Exception inner)
Parameters
lineNumber
intThe line number in the CSV file at which the error occurred.
fieldNumber
intThe field number at which the error occurred.
errorMessage
stringThe message that describes the error. This, prefaced with the line and field numbers (if non-zero), will make up the exception message.
inner
ExceptionThe exception that is the cause of the current exception. If the
inner
parameter is not a null reference (Nothing
in Visual Basic), the current exception is raised in a catch block that handles the inner exception.
CsvException(SerializationInfo, StreamingContext)
Initializes a new instance of the CsvException class with serialized data.
protected CsvException(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe object that holds the serialized object data.
context
StreamingContextThe contextual information about the source or destination.
Exceptions
- ArgumentNullException
info
is null.
CsvException(string)
Initializes a new instance of the CsvException class with a specified error message.
public CsvException(string message)
Parameters
message
stringThe message that describes the error.
CsvException(string, Exception)
Initializes a new instance of the CsvException class with a specified error message and a reference to the inner exception that is the cause of this exception.
public CsvException(string message, Exception inner)
Parameters
message
stringThe message that describes the error.
inner
ExceptionThe exception that is the cause of the current exception. If the
inner
parameter is not a null reference (Nothing
in Visual Basic), the current exception is raised in a catch block that handles the inner exception.
Properties
FieldNumber
Gets or sets the field number at which the error occurred.
public int FieldNumber { get; set; }
Property Value
Remarks
The first field is 1. If there is not an applicable field number, this will be zero.
LineNumber
Gets or sets the line number in the CSV file at which the error occurred.
public int LineNumber { get; set; }
Property Value
Remarks
The first line is 1. If there is not an applicable line number, this will be zero.
Methods
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo to populate with data.
context
StreamingContextThe destination (see StreamingContext) for this serialization.
Exceptions
- ArgumentNullException
info
is null.