The
HDR=Yes
extended property tells the driver that the Excel file has a header row that should be ignored. To get all rows (and skip the header rows after reading), use
HDR=No
.
Because you have two header rows, there may be still problems to retrieve the complete content and determine the correct column types. Using
ImportMixedTypes=text
(which is the default) together with
MaxScanRows=0
should help but requires that non text types must be converted later.
But the
ImportMixedTypes
and
TypeGuessRows
(
MaxScanRows
when used within connection string) properties are not processed when passed with the connection string. They are ignored and corresponding values from the registry are used instead.
See also these StackOverflow threads:
c# - Help with a OleDB connection string for excel files - Stack Overflow[
^]
c# - Reading Excel InterMixed DataType Without Modifying Registry Key - Stack Overflow[
^]
So you should try with
HDR=No
first and if that fails try after setting
TypeGuessRows=0
in the registry.