Class ToDataTableOptions¶
Namespace: OfficeOpenXml.Export.ToDataTable
Assembly: EPPlus.dll
This class contains options for the ToDataTable method of ExcelRangeBase.
Inheritance¶
Inherited Members¶
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Properties¶
AlwaysAllowNull¶
If true, the AllowNull will be overridden and null values will be allowed in all columns.
Property Value¶
ColumnNameParsingStrategy¶
ColumnNameParsingStrategy?text=NameParsingStrategy to use when parsing the first row of the range to column names
Property Value¶
ColumnNamePrefix¶
If no column names are specified, this prefix will be used followed by a number
Property Value¶
DataTableName¶
Name of the data table
Property Value¶
DataTableNamespace¶
Namespace of the data table
Property Value¶
EmptyRowStrategy¶
Sets how empty rows in the range are handled when detected
Property Value¶
ExcelErrorParsingStrategy¶
Sets how Excel error values are handled when detected.
Property Value¶
FirstRowIsColumnNames¶
If true, the first row of the range will be used to collect the column names of the DataTable. The column names will be set according to the ColumnNameParsingStrategy used.
Property Value¶
Mappings¶
Mappings that specifies columns from the range and how these should be mapped to the DataTable
Property Value¶
See Also¶
PredefinedMappingsOnly¶
If true, only columns that are specified in the Mappings collection are included in the DataTable.
Property Value¶
SkipNumberOfRowsEnd¶
Number of rows that will be skipped from the end (bottom) of the range.
Property Value¶
SkipNumberOfRowsStart¶
Number of rows that will be skipped from the start (top) of the range. If FirstRowIsColumnNames is true, this will be applied after the first row (column names) has been read.
Property Value¶
Methods¶
Create()¶
Creates an instance of ToDataTableOptions with default values set.
Returns¶
See Also¶
Create(Action<ToDataTableOptions>)¶
Creates an instance of ToDataTableOptions. Use the configHandler parameter to set the values on it.
Parameters¶
configHandler Action<ToDataTableOptions>
Use this to configure the ToDataTableOptions instance in a lambda expression body.
Returns¶
The configured ToDataTableOptions
SetPrimaryKey(params string[])¶
Sets the primary key of the data table.
Parameters¶
columnNames string[]
The name or names of one or more column in the DataTable that constitutes the primary key
SetPrimaryKey(params int[])¶
Sets the primary key of the data table.
Parameters¶
zeroBasedRangeIndexes int[]
The index or indexes of one or more column in the range that builds up the primary key of the DataTable