Importing Excel data into C# without first row becoming column names?

后端 未结 2 1423
抹茶落季
抹茶落季 2021-01-13 02:57

I am trying to import data from excel into a datatable using c#. Here is the code I use to do so...

string ConnString = \"Provider=Microsoft.Jet.OLEDB.4.0;\"         


        
相关标签:
2条回答
  • 2021-01-13 03:21

    The code sample you provided has HRD=No instead of HDR=No

    0 讨论(0)
  • 2021-01-13 03:26

    I used the NPOI library for just the task you inquired about and more. The only limitation is that it cannot yet handle the Excel 2007 format, so you are limited to the 97-2003 format.

    0 讨论(0)
提交回复
热议问题