ExcelWorksheetExtractToDataTable Method

Note: This API is now obsolete.

Extracts data to DataTable with the same column order as it is in ExcelWorksheet.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1033
Syntax
[ObsoleteAttribute("Use 'GemBox.Spreadsheet.ExcelWorksheet.ExtractToDataTable(System.Data.DataTable, GemBox.Spreadsheet.ExtractToDataTableOptions)' method instead. For more info, see http://www.gemboxsoftware.com/spreadsheet/help/html/Obsolete_Members.htm#ExcelWorksheetExtractToDataTable.")]
public void ExtractToDataTable(
	DataTable dataTable,
	int numberOfRows,
	ExtractDataOptions options,
	ExcelRow startRow,
	ExcelColumn startColumn
)

Parameters

dataTable
Type: System.DataDataTable
Destination DataTable.
numberOfRows
Type: SystemInt32
Number of rows to extract.
options
Type: GemBox.SpreadsheetExtractDataOptions
Options that describe how data will be extracted.
startRow
Type: GemBox.SpreadsheetExcelRow
Start ExcelRow.
startColumn
Type: GemBox.SpreadsheetExcelColumn
Start ExcelColumn.
Remarks

DataTable has to have all the columns defined before calling this method. Because DataColumnMapping objects are not used in this method, columns in DataTable have to have the same order as columns in ExcelWorksheet (starting from column defined in startColumn argument).

You can customize error handling by using ExtractDataEvent.

DataTable column type and corresponding cell value type need to be 'similar' data types. If that's not the case, then exception would be thrown. Note that numbers and string are not 'similar' data types. Numbers wouldn't be automatically converted to strings because of culture issues; someone would expect the number 12.4 is converted to "12.4" and someone else to "12,4". To make custom conversion, use ExtractDataEvent.

See Also