View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kim Carlsen Kim Carlsen is offline
external usenet poster
 
Posts: 8
Default header not in first row

Hi

How do I do a select from an excel file, where the headers is not in the
first row?
The first and second row contains some date and logo, so I want to start at
third row in my select.
is there some way to skip the two rows when reading?
the code looks like this:

String strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=c:\test.xlsx;Extended Properties=Excel 12.0;";
String strSelect = "SELECT [text] FROM [sheetname$]";
OleDbDataAdapter daMaster = new OleDbDataAdapter(strSelect, strConn);

Regards
Kim