Reading Excel file with C# - Choose sheet

Posted by Dänu on Stack Overflow See other posts from Stack Overflow or by Dänu
Published on 2010-05-16T16:29:50Z Indexed on 2010/05/16 16:30 UTC
Read the original article Hit count: 198

Filed under:
|
|
|

Hey Guys

I'm reading an excel file with C# and OleDB (12.0). There I have to specify the select statement with the name of the sheet I wish to read ([Sheet1$]).

this.dataAdapter = 
    new OleDbDataAdapter("SELECT * FROM [Sheet1$]", connectionString);

Is it possible to select the first sheet, no matter what name?

Thank you.

© Stack Overflow or respective owner

Related posts about excel

Related posts about c#