Reading EXCEL file really fast with C# RRS feed

  • Question

  • I am creating a application in which we need to read all Excel file in given folder, and then draw graph on basis on entries in these files (one graph per file) or one graph for all file based on user choice.

    Now I search internet and found 2 method of reading Excel files.

    1. Through OleDB,
    2. Through Excel Component

    I forgot to mention that each excel file we reach can have upto 80K records to read from.

    When we use OleDB method, we can read all 80K records in less or nearly 2 minutes. however when we try to read complete file through Excel Component it took 30-40 minute to read one file, since we can have more than 10 files with all 80K records we cannot afford to use Excel Component to read files.

    But we cannot use OleDB because if Excel file has 2 rows of header, oledb didn't read these Excel file and the source of this file generate the Header based on type of recording we are storing in these Exccel file, so it may or maynot have 2 headers.

    Do anyone please suggest what is best method to read these Excel file with speed of OleDB but with accuracy of reading like with excel component.

    Sumit Gupta
    Friday, July 17, 2009 12:17 PM


All replies

  • That would probably leave you with third-party options. Below is one that I am aware of that you may want to try:

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, July 17, 2009 2:24 PM
  • Hello,

    The problem is we cannot use third party software specially if they are paid :). Is there any free alternative?

    Maybe you can tell us how we can read Excel file using some other control or method? What is best method to read Excel file, can we write a Custom EXCEL Reader code ?

    Sumit Gupta
    Saturday, July 18, 2009 3:25 PM
  • As I know from all the tools coming from Microsoft, JET OELDB provider is probably the fastest. You might try to create custom reader, but, from my experience, it it is not that easy (I have authored components for You might need to focus on design of your applicationto see if you could come up with some sort of preprocessing or preloading data in advance of building graph, depending on the goals.
    Val Mazur (MVP)
    Monday, July 20, 2009 9:42 AM
  • You might want to try the free SpreadsheetGear download from Microsoft as well.

    I'm not aware of any other options.

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Monday, July 20, 2009 1:13 PM
  • thanks for the Component, but for those you are looking for free solution [and probably best] is to Use Microsoft Access Database Engine used instead of Jet Ole Driver can do the reading of Excel Sheet really well. Indeed this solution is not for Excel having picture or graph [I didn't try maybe they works]. But for Data only Excel ADE works just great for me.

    Sumit Gupta
    Tuesday, September 27, 2011 8:32 AM