public static void Fill(
DataTable dataTable,
CsvReader reader,
CsvMapping mapping
)
Public Shared Sub Fill (
dataTable As DataTable,
reader As CsvReader,
mapping As CsvMapping
)
public:
static void Fill(
DataTable^ dataTable,
CsvReader^ reader,
CsvMapping^ mapping
)
static member Fill :
dataTable : DataTable *
reader : CsvReader *
mapping : CsvMapping -> unit
Each PropertyName of mapping MUST have a corresponding DataColumn in dataTable - corresponding in the Caption property (case-insensitive) and the accepted data type.
Effort must be taken that the PropertyNames in mapping are unique, even when treated case-insensitive.
The DynamicProperty instances in mapping don't need to match all columns of the DataTable or all columns of the CSV file (neither in number nor in order).
It's recommended to initialize reader with the DisableCaching flag set.
ArgumentNullException | dataTable, or reader, or mapping is null. |
ArgumentException | There is a DynamicProperty in mapping whose PropertyName finds no corresponding ColumnName in dataTable. |
FormatException | Parsing fails and Throwing is true. |
NoNullAllowedException | The mapping doesn't match the schema of the dataTable. |
ConstraintException | The parsed CSV data does not match the schema of the dataTable. |
IOException | I/O error. |
ObjectDisposedException | The file was already closed. |