Class DataColumnMapping¶
Namespace: OfficeOpenXml.Export.ToDataTable
Assembly: EPPlus.dll
Class used to map columns in the ToDataTable(ToDataTableOptions, DataTable) method
Inheritance¶
Inherited Members¶
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Properties¶
AllowNull¶
Indicates whether empty cell values should be allowed. Corresponds to AllowDBNull
Property Value¶
ColumnDataType¶
Type?text=Type of the column, corresponds to DataType
Property Value¶
DataColumn¶
The DataColumn used for the mapping
Property Value¶
DataColumnName¶
Name of the data column, corresponds to ColumnName
Property Value¶
TransformCellValue¶
A function which allows casting of an object before it is written to the DataTable
Property Value¶
Examples¶
var options = ToDataTableOptions.Create(o =>
{
// the last argument is a lambda function that will call the read value's ToString method
// and this string will be written to the DataTable
o.Mappings.Add(0, "Id", typeof(string), true, c => "Id: " + c.ToString());
});
ZeroBasedColumnIndexInRange¶
Zero based index of the mappings column in the range