Read data from excel file in c# [duplicate]
Possible Duplicate:
Reading Excel files from C#
I'm开发者_JAVA技巧 searching some easy way to read data from excel file. How can I read data from ex. cell 4A? Is it possible? Or I must read dataRow? (If yes, how?)
Extra info: I haven't Microsoft Office, I use Open Office.
What version of excel document do you wish to read?
If you don't want to use Office Interop, you are going to need a 3rd party excel reading library.
For Excel 2007/2010 (xlsx) you want EPPlus (GPL) http://epplus.codeplex.com
For Excel 2003 (xls) you want NPOI (Apache License) http://code.google.com/p/npoi/
See this post, Read excel file from a stream.
You could also use OleDb... http://www.codeproject.com/KB/office/excel_using_oledb.aspx
You can use Open XML SDK to work with excel files (one of the adventeges for you - it doesn't require MS Office to be instaled). Take a look at it.
精彩评论