How to get data of a column of a sheet by c#

I have wrote a winform application that can open and read from a sheet of an excel file.I have used OleDbDataAdapter to read data and then set the data to a datatable. but my problem is that in this datatable the first row of data is used as the name of the columns however i want to use the base names that excel defines for each column (I mean "A B C ... AA AB ..." and so on).

Answers


Take a look at this answer Importing Excel data into C# without first row becoming column names?

It seems you need to change the connection string Extended Properties=\"Excel 8.0;HDR=No;IMEX=1;\" and make sure HDR=No is set.


Need Your Help

Open links in new window using AngularJS

javascript angularjs

Is there a way to tell AngularJS that I want links to be opened in new windows when the user clicks on them?

NPM does not install anything : it hangs

node.js npm

Whenever I want to install a module with NPM, it hangs at that stage: