NExcelReader class allows you to read the content of a whole excel file or a specified range of cells in a particular excel sheet.
When whole file was read each sheet of the file is transformed to a DataTable in the result DataSet with a Name equal to the name of the sheet.
The user can pass a string with a file name or a Stream as a source of the data.
C# |
Copy Code
|
---|---|
string filename = //the name of the excel file. string sheetName = // the name of the sheet. DataSet excelData = new NExcelReader().ReadAll(filename); … DataSet excelData = new NExcelReader().ReadRange(filename, sheetName, "A1:E3"); |
Visual Basic |
Copy Code
|
---|---|
Dim FileName As String = 'The name of the excel file. Dim SheetName As String = 'The name of the sheet. Dim ExcelData As DataSet = New NExcelReader().ReadAll(Filename) … Dim ExcelData As DataSet = New NExcelReader().ReadRange(Filename, SheetName, "A1:E3") |