i am trying to fetch some data from an excel file, the issue was that i read the first row as data so i decided to change the HDR in my connectionString to Yes but after that my program end up with the exception named in the topic title.
Here is my code and my query :
Calling :
DataTable dt = Utils.queryXlsFile(Qry, dbConnection);
The queryXlsFile method :
public static DataTable queryXlsFile(String query, OleDbConnection dbConnection)
{
OleDbDataAdapter dbCommand = new OleDbDataAdapter(query, dbConnection);
DataTable dt = new DataTable();
dbCommand.Fill(dt);
return dt;
}
And my query :
select top 10 * FROM [PERSONNE$] WHERE (((([F1] LIKE '% prénom %') OR ([F1] LIKE '% prénom')) OR ([F1] LIKE '%-prénom')))
My connection string seems to be good since i can open the connection with the file.
Thanks in advance for your help.