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

    Show / Hide Table of Contents

    ExtractToDataTableOptions Class

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

    Represents options for extracting data from ExcelWorksheet to System.Data.DataTable.

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

    Constructors

    ExtractToDataTableOptions(Int32, Int32, Int32)

    Initializes an instance of ExtractToDataTableOptions class.

    • C#
    • VB.NET
    public ExtractToDataTableOptions(int startRow, int startColumn, int numberOfRows)
    Public Sub New(startRow As Integer, startColumn As Integer, numberOfRows 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.

    ExtractToDataTableOptions(String, Int32)

    Initializes an instance of ExtractToDataTableOptions class.

    • C#
    • VB.NET
    public ExtractToDataTableOptions(string startCell, int numberOfRows)
    Public Sub New(startCell As String, numberOfRows 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.

    Properties

    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.

    MappingCollection

    Gets the collection used for mapping ExcelWorksheet columns to System.Data.DataTable columns.

    • C#
    • VB.NET
    public DataColumnMappingCollection MappingCollection { get; }
    Public ReadOnly Property MappingCollection As DataColumnMappingCollection
    Property Value
    System.Data.Common.DataColumnMappingCollection
    Remarks

    StartColumn is ignored if MappingCollection 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

    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 MappingCollection 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

    Events

    ExcelCellToDataTableCellConverting

    Event that fires when converting ExcelCell value to System.Data.DataTable cell value.

    • C#
    • VB.NET
    public event EventHandler<ExcelCellToDataTableCellConvertingEventArgs> ExcelCellToDataTableCellConverting
    Public Event ExcelCellToDataTableCellConverting As EventHandler(Of ExcelCellToDataTableCellConvertingEventArgs)
    Event Type
    System.EventHandler<ExcelCellToDataTableCellConvertingEventArgs>

    Examples

    Export Excel sheet into DataTable in C# and VB.NET

    See Also

    ExtractToDataTable(DataTable, ExtractToDataTableOptions)
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.