Lets discuss a generic excel connection a bit:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;
HDR=Yes;
IMEX=1
;"
The
HDR=YES tells the JET engine to use the first row as
column headers.
Suppose you have two columns in excel "Name" and "Amount" in the first
row. Now if you use the HDR=YES than it will treat the first row as
column identifiers, not as data. Else it will treat is as data.
Also there is the
IMEX=1 option. That will tell the engine to treat
intermixed data types in the same column(numbers, text...) as text.
If you don't use it and have two different data types on the same column
an exception is bound to happen. For more info visit
here
As a different suggestion Try not using a data adapter but create a class
to mimic the file structure and use a datareader to read the contents while making sure you ignore null/empty values/rows.
:)