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.

Afficher le fichier Open project: accord-net/framework Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
initialize ( string path, bool hasHeaders, bool hasMixedData ) : void

Method Details

ExcelReader() public méthode

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.
Résultat System

ExcelReader() public méthode

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.
Résultat System

ExcelReader() public méthode

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.
Résultat System

ExcelReader() public méthode

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

ExcelReader() public méthode

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.
Résultat System

ExcelReader() public méthode

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.
Résultat System

GetColumnsList() public méthode

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

GetWorksheet() public méthode

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

GetWorksheet() public méthode

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

GetWorksheet() public méthode

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

GetWorksheetList() public méthode

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