3

I am using ACE OLEDB to load an excel file into a DataTable.

I have a list of the columns I need to grab from the file (column names).

Problem is I couldn't find any working source on how to get only those specific columns from the Excel into the DataTable.

Cătălin Rădoi
  • 1,804
  • 23
  • 43

1 Answers1

5

You can query columns like you would any other SQL sentence:

SELECT [columnName1], [columnName2] FROM Sheet1

columnName should be the value in the header of the column that you are trying to get.

maniak1982
  • 707
  • 2
  • 7
  • 23