Posted on: 10/4/2013 3:24:16 AM | Views : 282

Hi,
I am using EPPlus.dll for export excel to datatable.
Dim pck = New OfficeOpenXml.ExcelPackage() pck.Load(New IO.FileInfo(FilePath).OpenRead) If pck.Workbook.Worksheets.Count <> 0 Then Dim ws = pck.Workbook.Worksheets.First Dim hasHeader = True ' adjust accordingly ' For Each firstRowCell In ws.Cells(1, 1, 1, ws.Dimension.End.Column) dt.Columns.Add(If(hasHeader, firstRowCell.Text, String.Format("Column {0}", firstRowCell.Start.Column))) Next Dim startRow = If(hasHeader, 2, 1) For rowNum = startRow To ws.Dimension.End.Row Dim wsRow = ws.Cells(rowNum, 1, rowNum, ws.Dimension.End.Column) dt.Rows.Add(wsRow.Select(Function(cell) cell.Text).ToArray) Next End If From above code , total rows is adding to datatable. 
I have a date column in th ...

Go to the complete details ...