HomeCommunityControl GalleryData & XML.NET xlReader for Microsoft® Excel 3.0

.NET xlReader for Microsoft® Excel 3.0



(2) Submit a Review

585 Downloads

13,876 Views


Description

ExcelClient.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.

Syntax Example

C# Sample code //Sample code retrieves data and populates DataSet from two spreadsheets //inside of Excel file. ExcelDataAdapter excelAdapter; DataSet result; string format = cmbFormat.SelectedItem.ToString(); string pathToFile = "..\\..\\AuthorsInfo.xlsx"; try { //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 excelAdapter.Fill(result); //Do something with the DataTables here dataGridView1.DataSource = result.Tables[0]; dataGridView2.DataSource = result.Tables[1]; //Release all the opened resources excelAdapter.Dispose(); 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" Try '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 excelAdapter.Fill(result) 'Do something with the DataTables here dataGridView1.DataSource = result.Tables(0) dataGridView2.DataSource = result.Tables(1) 'Release all the opened resources excelAdapter.Dispose() excelAdapter = Nothing Catch ex As Exception MessageBox.Show(ex.Message) End Try

Reviews

Submit a review

ss

Reviewed by: sindy123 on Saturday, March 15, 2008

5 Stars

ss

Great tool, great support

Reviewed by: debernard on Tuesday, November 13, 2007

5 Stars

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!