GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    CreateDataTableOptions Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents options creating System.Data.DataTable and filling it with values from ExcelWorksheet.

    • C#
    • VB.NET
    public sealed class CreateDataTableOptions
    Public NotInheritable Class CreateDataTableOptions
    Inheritance:
    System.Object
    CreateDataTableOptions
    Remarks

    Use default constructor to extract used cell range.

    Constructors

    CreateDataTableOptions()

    Initializes an instance of CreateDataTableOptions class.

    • C#
    • VB.NET
    public CreateDataTableOptions()
    Public Sub New
    Remarks

    Use this constructor to extract used cell range.

    CreateDataTableOptions(Int32, Int32, Int32, Int32)

    Initializes an instance of CreateDataTableOptions class.

    • C#
    • VB.NET
    public CreateDataTableOptions(int startRow, int startColumn, int numberOfRows, int numberOfColumns)
    Public Sub New(startRow As Integer, startColumn As Integer, numberOfRows As Integer, numberOfColumns As Integer)
    Parameters
    startRow
    System.Int32

    Index of the first row of data being extracted from ExcelWorksheet.

    startColumn
    System.Int32

    Index of the first column of data being extracted from ExcelWorksheet.

    numberOfRows
    System.Int32

    Number of rows being extracted from ExcelWorksheet.

    numberOfColumns
    System.Int32

    Number of columns being extracted from ExcelWorksheet.

    CreateDataTableOptions(String, Int32, Int32)

    Initializes an instance of CreateDataTableOptions class.

    • C#
    • VB.NET
    public CreateDataTableOptions(string startCell, int numberOfRows, int numberOfColumns)
    Public Sub New(startCell As String, numberOfRows As Integer, numberOfColumns As Integer)
    Parameters
    startCell
    System.String

    Name of the first (top left) cell of data being extracted from ExcelWorksheet.

    numberOfRows
    System.Int32

    Number of rows being extracted from ExcelWorksheet.

    numberOfColumns
    System.Int32

    Number of columns being extracted from ExcelWorksheet.

    Properties

    ColumnHeaders

    Gets or sets a value indicating whether to use first row of extracted data for column headers.

    • C#
    • VB.NET
    public bool ColumnHeaders { get; set; }
    Public Property ColumnHeaders As Boolean
    Property Value
    System.Boolean

    ColumnHeadersComparer

    Gets or sets the comparison operation that's used for resolving names of column headers.

    • C#
    • VB.NET
    public StringComparer ColumnHeadersComparer { get; set; }
    Public Property ColumnHeadersComparer As StringComparer
    Property Value
    System.StringComparer
    Remarks

    Default value is System.StringComparer.Ordinal.

    ColumnIndexes

    Gets a list of indexes of columns which will be extracted.

    • C#
    • VB.NET
    public IList<int> ColumnIndexes { get; }
    Public ReadOnly Property ColumnIndexes As IList(Of Integer)
    Property Value
    System.Collections.Generic.IList<System.Int32>
    Remarks

    StartColumn and NumberOfColumns are ignored if ColumnIndexes has any values.

    ExtractDataOptions

    Gets or sets ExtractDataOptions.

    • C#
    • VB.NET
    public ExtractDataOptions ExtractDataOptions { get; set; }
    Public Property ExtractDataOptions As ExtractDataOptions
    Property Value
    ExtractDataOptions
    Remarks

    Default value is None.

    NumberOfColumns

    Gets or sets the number of columns being extracted from ExcelWorksheet.

    • C#
    • VB.NET
    public int NumberOfColumns { get; set; }
    Public Property NumberOfColumns As Integer
    Property Value
    System.Int32
    Remarks

    NumberOfColumns is ignored if ColumnIndexes has any values.

    NumberOfRows

    Gets or sets the number of rows being extracted from ExcelWorksheet.

    • C#
    • VB.NET
    public int NumberOfRows { get; set; }
    Public Property NumberOfRows As Integer
    Property Value
    System.Int32

    Resolution

    Gets or sets the resolution type that specifies how column types will be resolved in created System.Data.DataTable, see ColumnTypeResolution.

    • C#
    • VB.NET
    public ColumnTypeResolution Resolution { get; set; }
    Public Property Resolution As ColumnTypeResolution
    Property Value
    ColumnTypeResolution
    Remarks

    Default value is Auto.

    StartColumn

    Gets or sets the index of the first column of data being extracted from ExcelWorksheet.

    • C#
    • VB.NET
    public int StartColumn { get; set; }
    Public Property StartColumn As Integer
    Property Value
    System.Int32
    Remarks

    StartColumn is ignored if ColumnIndexes has any values.

    StartRow

    Gets or sets the index of the first row of data being extracted from ExcelWorksheet.

    • C#
    • VB.NET
    public int StartRow { get; set; }
    Public Property StartRow As Integer
    Property Value
    System.Int32

    Examples

    Create DataTable from Excel sheet in C# and VB.NET

    See Also

    CreateDataTable(CreateDataTableOptions)
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.