This project has moved and is read-only. For the latest updates, please go here.

Create Excel Worksheet from SqlDataReader/CsvReader

Jun 16, 2011 at 3:29 AM

Is there any methods in your library to create an excel worksheet from a SqlDataReader or CsvReader? An example would be i have 2 or 3 sql queries that I want rows dumped to individual Excel Worksheets within the same Workbook.  The same could be true to load several CSV files into separate Worksheets.


Jun 16, 2011 at 4:33 PM

There is no build in support for SqlDataReaders or CsvReaders, but you can read a csv file using the Range.LoadFromText method (as in sample 9).

Jun 16, 2011 at 7:03 PM

Got it, thanks. This will work in the short term, but due to the large size of csv files i'm dealing with, it is definitely a hit on memory. In this specific case, I don't want to cache everything. I want to search everything in a fast-forward way, and only keep portions of the rows from the csv file.

Feb 2, 2014 at 7:24 PM
I have created a pull request to implement this. Please test.