Table of Contents

Method AddMapping

Namespace
YndigoBlue.Velocity.Model
Assembly
YndigoBlue.Velocity.dll

AddMapping(string, string, DataType)

Adds a mapping from a CSV header to a database column with the specified data type.

public void AddMapping(string header, string columnName, DataType columnType)

Parameters

header string

The CSV column header name.

columnName string

The target database column name.

columnType DataType

The DataType of the target column, used to convert the CSV string value.

Exceptions

Exception

Thrown when columnType is not a valid importable data type (e.g. String, Query, Guid, Unsupported).

AddMapping(int, string, DataType)

Adds a positional mapping for a headerless import, binding the zero-based source field at columnNumber in each row to the target database column. Because the source position is explicit, fields in the file may be skipped or read out of order. The ordinal is ignored when UseColumnHeaders is true, since name-based binding is used in that case.

public void AddMapping(int columnNumber, string columnName, DataType columnType)

Parameters

columnNumber int

Zero-based index of the source field within each file row.

columnName string

The target database column name.

columnType DataType

The DataType of the target column, used to convert the value.

Exceptions

ArgumentOutOfRangeException

Thrown when columnNumber is negative.

Exception

Thrown when columnType is not a valid importable data type.