C# Class Accord.IO.ExcelReader

Excel file reader using Microsoft Jet Database Engine.

This class requires the Microsoft Access Database Engine to work. The download is available from Microsoft under the name "Microsoft Access Database Engine 2010 Redistributable", available in both 32-bit (x86) and 64-bit (x64) versions.

By default, the redistributable package will only install if it is the same as the current version of Microsoft Office installed in the machine (i.e. ACE 32-bit can not be installed with 64-bit office and vice-versa). To overcome this limitation and install both versions of the ACE drivers, specify /passive as a command line argument when installing the packages.

Mostra file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
ExcelReader ( Stream stream, bool xlsx ) : System

Creates a new spreadsheet reader.

ExcelReader ( Stream stream, bool xlsx, bool hasHeaders ) : System

Creates a new spreadsheet reader.

ExcelReader ( Stream stream, bool xlsx, bool hasHeaders, bool hasMixedData ) : System

Creates a new spreadsheet reader.

ExcelReader ( string path ) : System

Creates a new spreadsheet reader.

ExcelReader ( string path, bool hasHeaders ) : System

Creates a new spreadsheet reader.

ExcelReader ( string path, bool hasHeaders, bool hasMixedData ) : System

Creates a new spreadsheet reader.

GetColumnsList ( string worksheet ) : string[]

Gets the list of columns in a worksheet.

GetWorksheet ( ) : DataSet

Gets the entire worksheet as a data set.

GetWorksheet ( int worksheetIndex ) : DataTable

Gets an worksheet as a data table.

GetWorksheet ( string worksheet ) : DataTable

Gets an worksheet as a data table.

GetWorksheetList ( ) : string[]

Gets the list of worksheets in the spreadsheet.

Private Methods

Method Description
initialize ( string path, bool hasHeaders, bool hasMixedData ) : void

Method Details

ExcelReader() public method

Creates a new spreadsheet reader.
public ExcelReader ( Stream stream, bool xlsx ) : System
stream Stream The stream containing the spreadsheet file.
xlsx bool True if the file should be treated as .xlsx file, false otherwise. Default is true.
return System

ExcelReader() public method

Creates a new spreadsheet reader.
public ExcelReader ( Stream stream, bool xlsx, bool hasHeaders ) : System
stream Stream The stream containing the spreadsheet file.
xlsx bool True if the file should be treated as .xlsx file, false otherwise. Default is true.
hasHeaders bool True if the spreadsheet contains headers, false otherwise. Default is true.
return System

ExcelReader() public method

Creates a new spreadsheet reader.
public ExcelReader ( Stream stream, bool xlsx, bool hasHeaders, bool hasMixedData ) : System
stream Stream The stream containing the spreadsheet file.
xlsx bool True if the file should be treated as .xlsx file, false otherwise. Default is true.
hasHeaders bool True if the spreadsheet contains headers, false otherwise. Default is true.
hasMixedData bool True to read "intermixed" data columns as text, false otherwise. Default is true.
return System

ExcelReader() public method

Creates a new spreadsheet reader.
public ExcelReader ( string path ) : System
path string The path of for the spreadsheet file.
return System

ExcelReader() public method

Creates a new spreadsheet reader.
public ExcelReader ( string path, bool hasHeaders ) : System
path string The path of for the spreadsheet file.
hasHeaders bool True if the spreadsheet contains headers, false otherwise. Default is true.
return System

ExcelReader() public method

Creates a new spreadsheet reader.
public ExcelReader ( string path, bool hasHeaders, bool hasMixedData ) : System
path string The path of for the spreadsheet file.
hasHeaders bool True if the spreadsheet contains headers, false otherwise. Default is true.
hasMixedData bool True to read "intermixed" data columns as text, false otherwise. Default is true.
return System

GetColumnsList() public method

Gets the list of columns in a worksheet.
public GetColumnsList ( string worksheet ) : string[]
worksheet string
return string[]

GetWorksheet() public method

Gets the entire worksheet as a data set.
public GetWorksheet ( ) : DataSet
return System.Data.DataSet

GetWorksheet() public method

Gets an worksheet as a data table.
public GetWorksheet ( int worksheetIndex ) : DataTable
worksheetIndex int
return System.Data.DataTable

GetWorksheet() public method

Gets an worksheet as a data table.
public GetWorksheet ( string worksheet ) : DataTable
worksheet string
return System.Data.DataTable

GetWorksheetList() public method

Gets the list of worksheets in the spreadsheet.
public GetWorksheetList ( ) : string[]
return string[]