Click here to Skip to main content
15,883,955 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Dear All

How i import data from excel 2010 to dotnet C#?
Posted

http://exceldatareader.codeplex.com
 
Share this answer
 
Have a look at Excel Data Reader - Read Excel files in .NET[^] and EPPlus[^]

The libraries lets you to import the data, even if Excel is not installed on the computer.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Herman<T>.Instance 24-Apr-14 8:23am    
I like EPPLUS> very effective and performing component
Google broken?

Interop ring any bells?

Here is a link to one short brief blog about it http://blogs.popart.com/2008/07/importing-data-from-excel-with-c/[^].

I am sure you will find many more better articles if you apply a bit of effort. You could have found these in the time it took you to ask such an open question.
 
Share this answer
 
 
Share this answer
 
Just save it as csv
and import it as string[] lines =File.readAllLines("path.csv");
 
Share this answer
 
Here is a good way to read both csv and Excel.
https://toxy.codeplex.com/wikipage?title=Load%20Excel%20into%20DataSet%20with%20Toxy
 
Share this answer
 
You can try the below:

C#
string path = fileuploadExcel.PostedFile.FileName;
           string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;Persist Security Info=False";
              InsertExceldata(excelConnectionString);
             
           }


In InsertExceldata method do what you desire with the imported data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900