Add rows faster to datatable

Hi devs, pls assist I have rows of more than 90000 but I am using dt.rows.add to
populate the datatable however it’s taking forever to process,pls assist


First of all how are you getting that data as?

Into separate variables? Or anything else?


For rowIndex As Integer = 2 To rowCount
    'Dim newDataRow As System.Data.DataRow = dt.NewRow()
	Dim newDataRow As New datarow()
    For columnIndex As Integer = 1 To columnCount
        newDataRow(columnIndex - 1) = CType(excelRange.Cells(rowIndex, columnIndex), Microsoft.Office.Interop.Excel.Range).Value

Looks like you arr removing the first two rows and getting all other rows…is that the requirement?

If so dt.AsEnumerable.Skip(2).CopyToDataTable will do that

Or if you are try to read excel. El wise…why is it? What not use read range activity?