public static void Write(
DataTable dataTable,
CsvWriter writer,
CsvMapping mapping
)Public Shared Sub Write (
dataTable As DataTable,
writer As CsvWriter,
mapping As CsvMapping
)public:
static void Write(
DataTable^ dataTable,
CsvWriter^ writer,
CsvMapping^ mapping
)static member Write :
dataTable : DataTable *
writer : CsvWriter *
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).
| ArgumentNullException | dataTable, or writer, or mapping is null. |
| ArgumentException | There is a DynamicProperty in mapping whose PropertyName finds no corresponding ColumnName in dataTable. |
| InvalidCastException | A value in dataTable does not match the expected data type in mapping. |
| FormatException | One of the TypeConverterT instances uses an invalid format string. |
| IOException | I/O error. |
| ObjectDisposedException | The file was already closed. |