Class ToDataTableOptions
This class contains options for the ToDataTable method of Excel
Inheritance
Inherited Members
Namespace: OfficeOpenXml.Export.ToDataTable
Assembly: EPPlus.dll
Syntax
public class ToDataTableOptions
Properties
AlwaysAllowNull
If true, the Allow
Declaration
public bool AlwaysAllowNull { get; set; }
Property Value
Type | Description |
---|---|
System. |
ColumnNameParsingStrategy
Name
Declaration
public NameParsingStrategy ColumnNameParsingStrategy { get; set; }
Property Value
Type | Description |
---|---|
Name |
ColumnNamePrefix
If no column names are specified, this prefix will be used followed by a number
Declaration
public string ColumnNamePrefix { get; set; }
Property Value
Type | Description |
---|---|
System. |
DataIsTransposed
Set to true if the worksheet is contains transposed data.
Declaration
public bool DataIsTransposed { get; set; }
Property Value
Type | Description |
---|---|
System. |
DataTableName
Name of the data table
Declaration
public string DataTableName { get; set; }
Property Value
Type | Description |
---|---|
System. |
DataTableNamespace
Namespace of the data table
Declaration
public string DataTableNamespace { get; set; }
Property Value
Type | Description |
---|---|
System. |
EmptyRowStrategy
Sets how empty rows in the range are handled when detected
Declaration
public EmptyRowsStrategy EmptyRowStrategy { get; set; }
Property Value
Type | Description |
---|---|
Empty |
ExcelErrorParsingStrategy
Sets how Excel error values are handled when detected.
Declaration
public ExcelErrorParsingStrategy ExcelErrorParsingStrategy { get; set; }
Property Value
Type | Description |
---|---|
Excel |
FirstRowIsColumnNames
If true, the first row of the range will be used to collect the column names of the System.
Declaration
public bool FirstRowIsColumnNames { get; set; }
Property Value
Type | Description |
---|---|
System. |
Mappings
Mappings that specifies columns from the range and how these should be mapped to the System.
Declaration
public DataColumnMappingCollection Mappings { get; }
Property Value
Type | Description |
---|---|
Data |
See Also
PredefinedMappingsOnly
If true, only columns that are specified in the Mappings collection are included in the DataTable.
Declaration
public bool PredefinedMappingsOnly { get; set; }
Property Value
Type | Description |
---|---|
System. |
SkipNumberOfRowsEnd
Number of rows that will be skipped from the end (bottom) of the range.
Declaration
public int SkipNumberOfRowsEnd { get; set; }
Property Value
Type | Description |
---|---|
System. |
SkipNumberOfRowsStart
Number of rows that will be skipped from the start (top) of the range. If First
Declaration
public int SkipNumberOfRowsStart { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
Create()
Creates an instance of ToDataTableOptions with default values set.
Declaration
public static ToDataTableOptions Create()
Returns
Type | Description |
---|---|
To |
See Also
Create(Action<ToDataTableOptions>)
Creates an instance of ToconfigHandler
parameter to set the values on it.
Declaration
public static ToDataTableOptions Create(Action<ToDataTableOptions> configHandler)
Parameters
Type | Name | Description |
---|---|---|
System. |
configHandler | Use this to configure the To |
Returns
Type | Description |
---|---|
To |
The configured To |
SetPrimaryKey(Int32[])
Sets the primary key of the data table.
Declaration
public void SetPrimaryKey(params int[] zeroBasedRangeIndexes)
Parameters
Type | Name | Description |
---|---|---|
System. |
zeroBasedRangeIndexes | The index or indexes of one or more column in the range that builds up the primary key of the System. |
SetPrimaryKey(String[])
Sets the primary key of the data table.
Declaration
public void SetPrimaryKey(params string[] columnNames)
Parameters
Type | Name | Description |
---|---|---|
System. |
columnNames | The name or names of one or more column in the System. |