Link to home
Start Free TrialLog in
Avatar of CDFA_Inc2
CDFA_Inc2

asked on

Reading Excel Files in ASP.NET

How can i read through an Excel File and store it in a dataset using c# code?

Thanks
Avatar of rajaloysious
rajaloysious

You can use Ole Automation objects - Excel Library

Objects like Excel.Application, Excel.Worksheet etc

This also may be of help:
http://www.codeproject.com/csharp/csharp_excel.asp

cheers
you can use System.Data.OleDbClient

so you use the usual ADO.NET with...

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;"""

so you can query, and get DataSets.....

Regards
ASKER CERTIFIED SOLUTION
Avatar of fromeroj
fromeroj

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
and a query could be...
Select * FROM ['Sheet 1$']
Avatar of Bob Learned
Wow!!!  8 open questions in less than a week.  I can foresee some serious question abandonment out of this one.

Bob
Avatar of CDFA_Inc2

ASKER

im getting a --- Keyword not supported: 'provider'.---- error

Thanks