How can i select specific columns from excel sheet in c#?

前端 未结 3 1124
深忆病人
深忆病人 2020-12-10 19:43

How can I select specific columns from excel sheet rather than all columns

string connectionString = String.Format(@\"Provider=Microsoft.ACE.OLEDB.12.0;Data         


        
3条回答
  •  难免孤独
    2020-12-10 20:37

    This will sound trivial but this is what I understand from your question. Instead of SELECT * use SELECT [columnName1],[columnName2] FROM Sheet1.. Here columnName1 and columnName2 should be the headers of columns that you want to get from Excel Sheet.

提交回复
热议问题