• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

Reading Excel Files in ASP.NET

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

Thanks
0
CDFA_Inc2
Asked:
CDFA_Inc2
1 Solution
 
rajaloysiousCommented:
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
0
 
fromerojCommented:
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
0
 
fromerojCommented:
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\My Documents\Book20.xls;Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1;\"";
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
fromerojCommented:
and a query could be...
Select * FROM ['Sheet 1$']
0
 
Bob LearnedCommented:
Wow!!!  8 open questions in less than a week.  I can foresee some serious question abandonment out of this one.

Bob
0
 
CDFA_Inc2Author Commented:
im getting a --- Keyword not supported: 'provider'.---- error

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now