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
lineNumberintThe line number in the CSV file at which the error occurred.
fieldNumberintThe field number at which the error occurred.
exceptionExceptionThe 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
lineNumberintThe line number in the CSV file at which the error occurred.
fieldNumberintThe field number at which the error occurred.
errorMessagestringThe 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
lineNumberintThe line number in the CSV file at which the error occurred.
fieldNumberintThe field number at which the error occurred.
errorMessagestringThe message that describes the error. This, prefaced with the line and field numbers (if non-zero), will make up the exception message.
innerExceptionThe exception that is the cause of the current exception. If the
innerparameter is not a null reference (Nothingin 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
infoSerializationInfoThe object that holds the serialized object data.
contextStreamingContextThe contextual information about the source or destination.
Exceptions
- ArgumentNullException
infois null.
CsvException(string)
Initializes a new instance of the CsvException class with a specified error message.
public CsvException(string message)
Parameters
messagestringThe 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
messagestringThe message that describes the error.
innerExceptionThe exception that is the cause of the current exception. If the
innerparameter is not a null reference (Nothingin 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
infoSerializationInfoThe SerializationInfo to populate with data.
contextStreamingContextThe destination (see StreamingContext) for this serialization.
Exceptions
- ArgumentNullException
infois null.