C# Класс 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.

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
initialize ( string path, bool hasHeaders, bool hasMixedData ) : void

Описание методов

ExcelReader() публичный Метод

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.
Результат System

ExcelReader() публичный Метод

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.
Результат System

ExcelReader() публичный Метод

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.
Результат System

ExcelReader() публичный Метод

Creates a new spreadsheet reader.
public ExcelReader ( string path ) : System
path string The path of for the spreadsheet file.
Результат System

ExcelReader() публичный Метод

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.
Результат System

ExcelReader() публичный Метод

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.
Результат System

GetColumnsList() публичный Метод

Gets the list of columns in a worksheet.
public GetColumnsList ( string worksheet ) : string[]
worksheet string
Результат string[]

GetWorksheet() публичный Метод

Gets the entire worksheet as a data set.
public GetWorksheet ( ) : DataSet
Результат System.Data.DataSet

GetWorksheet() публичный Метод

Gets an worksheet as a data table.
public GetWorksheet ( int worksheetIndex ) : DataTable
worksheetIndex int
Результат System.Data.DataTable

GetWorksheet() публичный Метод

Gets an worksheet as a data table.
public GetWorksheet ( string worksheet ) : DataTable
worksheet string
Результат System.Data.DataTable

GetWorksheetList() публичный Метод

Gets the list of worksheets in the spreadsheet.
public GetWorksheetList ( ) : string[]
Результат string[]