skip first row in read of Excel file

后端 未结 4 511
春和景丽
春和景丽 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:22

    Just like Thit Lwin has commented. Remove first row before set dt as datasource.

    DataRow row = dt.Rows[0];
    dt.Rows.Remove(row);
    techGrid.DataSource = dt;
    

提交回复
热议问题