Load excel data to datatable

Oct 13, 2011 at 9:52 AM
Edited Oct 13, 2011 at 11:19 AM

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 5:25 AM

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