Question

I am trying to get data from an excel file to parse to a table in my database. Basically I am trying to read an excel file and copy all the data to a database.

I tried some different methods but did not succeed. I mainly tried to use Reading Excel files from C#

Can someone help me with this.

I am using windows 7 64bit.

Was it helpful?

Solution

Use .NET libraries for excel, they are generally easier to use, and doesn't require excel installed on target machine.

NPOI for .xls (Excel 2003 and lower), and EPPlus for xslx (2007+)

OTHER TIPS

Project -> Add Reference -> LATEST Microsoft.Office.Interop.Excel
And then you have this example on how to access the data in a workbook:
Reading data from excel 2010 using Microsoft.Office.Interop.Excel

I hope this is your solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top