I am trying to use C# to read excel file which has intermixed datatype. Below is my connection string
var path = //xls location
var MyConnection = new OleDbC
What you can do is to require having header in first row of Excel and set connection string to
var MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + path + "';Extended Properties='Excel 8.0;HDR=No;IMEX=1;'");
The key here is to set HDR=No (NO HEADER), however since you have header now each column will be treated as string (text), and you can do parsing or validation on each cell value. Of course you will need to skip or remove first row, since it contains header information.
Instead of using OleDb
I know use Excel Data Reader. It works greatly! Highly recommended!