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

Load excel data to datatable

Oct 13, 2011 at 10:52 AM
Edited Oct 13, 2011 at 12:19 PM

There's a way to load to datatable the excel data? I wanna show it on a datagridview.

For example, this method should get an array data, but i can only gets an object from property call "value"

int maxRow= package.Workbook.Worksheets[1].Dimension.End.Row;
int maxCol= package.Workbook.Worksheets[1].Dimension.End.Column;              
new ExcelPackage(ExistingFile).Workbook.Worksheets[1].Cells[1, 1, maxRow, maxCol].Value

Oct 19, 2011 at 6:25 AM

You have to populate it cell by cell, or use Linq like in the samples.