.NET xlReader for Microsoft® Excel 3.0
|Source Code Available
||April 27, 2010
||May 21, 2010
||1.x, 2.0, 3.5
.NET xlReader for Microsoft® Excel is a set of the classes, designed to read XLS, XLT, XLSX, XLTX and XLTM Microsoft® Excel files from .NET applications. To provide familiar feel and look for the developers and allow future extension of the component, current version of the .NET xlReader for Microsoft® Excel implemented as a .NET Managed Provider with the read-only capabilities and allows to read the data from the native Microsoft® Excel files without using any additional providers or Microsoft® Excel. .NET xlReader for Microsoft® Excel is a 100% .NET managed code and designed to achieve the best performance with the minimal usage of the RAM.
C# Sample code
//Sample code retrieves data and populates DataSet from two spreadsheets
//inside of Excel file.
string format = cmbFormat.SelectedItem.ToString();
string pathToFile = "..\\..\\AuthorsInfo.xlsx";
//Create an ExceldataAdapter to retrieve data into the DataSet.
//Overloaded constructor accepts query and connection string.
//Specify that first row in a spreadsheet is a header row (HDR=true)
excelAdapter = new ExcelDataAdapter("Authors;Titles", "Data Source=" + pathToFile +
";HDR=true;Format=" + format);
result = new DataSet();
//Get data from the file
//Do something with the DataTables here
dataGridView1.DataSource = result.Tables;
dataGridView2.DataSource = result.Tables;
//Release all the opened resources
excelAdapter = null;
VB.NET Sample Code
'Sample code retrieves data and populates DataSet from two spreadsheets
'inside of Excel file.
Dim excelAdapter As ExcelDataAdapter
Dim result As DataSet
Dim format As String = cmbFormat.SelectedItem.ToString()
Dim pathToFile As String = "..\AuthorsInfo.xlsx"
'Create an ExceldataAdapter to retrieve data into the DataSet.
'Overloaded constructor accepts query and connection string.
'Specify that first row in a spreadsheet is a header row (HDR=true)
excelAdapter = New ExcelDataAdapter("Authors;Titles", "Data Source=" & pathToFile & ";HDR=true;Format=" & format)
result = New DataSet()
'Get data from the file
'Do something with the DataTables here
dataGridView1.DataSource = result.Tables(0)
dataGridView2.DataSource = result.Tables(1)
'Release all the opened resources
excelAdapter = Nothing
Catch ex As Exception
Submit a review
Reviewed by: sindy123 on Saturday, March 15, 2008
Great tool, great support
Reviewed by: debernard on Tuesday, November 13, 2007
This tool does exactly what you expect, reading Excel spreadsheets from within your .NET application. It's fast, lightweight and easy to install and use. However, the best thing about using this tool is the support provided by the author. In a situation that was not the fault of the tool, Val went above and beyond the call of duty in helping us troubleshoot the application (over a weekend, no less), including providing us with a specially compiled instrumented version. Kudos!