How to use xlReader for MS-EXCEL

In this article i will tell you about How can use .Net xlReader in Excel-2007
  • 2592

Introduction

.NET xlReader for MS-Excel is a set of classes, specifically designed to read MS-Excel files from .NET applications. The latest version of the component is implemented as a .NET Managed Provider with read-only capabilities which allow it to read data from native MS-Excel files without the need to use MS-Excel or any additional providers. This also results in a familiar look-and-feel and allows for future extension of the component. .NET xlReader uses 100% .NET managed code and is designed to use minimal PC memory to achieve maximum performance.

Coding

VB.NET code sample

Imports VM.xPort.ExcelClient
Dim myConnection As ExcelConnection = New ExcelConnection;();
myConnection.ConnectionString = myConnectionString
myConnection.Open()
//execute queries, etc
myConnection.Close()

C# code sample

using VM.xPort.ExcelClient;
ExcelConnection myConnection = new ExcelConnection;();
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
//execute queries, etc
myConnection.Close();


Herder row in Excel file

Data Source =c:\myExcelFile.xls;HDR=yes;Format=xls;

           If don't use Herder in Excel for this we can use this code

Data Source =c:\myExcelFile.xls;HDR=no;Format=xls;

 

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

 


 

 

 

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.