skip first row in read of Excel file

后端 未结 4 517
春和景丽
春和景丽 2020-12-17 02:43

Hello I\'m trying to translate an Excel file to my dataGridView and it\'s having column name issues because the way the Excel file is formatted, there are two setup cells fo

4条回答
  •  鱼传尺愫
    2020-12-17 03:32

    You can skip as many rows you want like this

    IEnumerable newRows = dt.AsEnumerable().Skip(numberOfRows);
    DataTable  dt2 = newRows.CopyToDataTable();
    

提交回复
热议问题