In this case, system detects
that first row is blank, hence it determines it as
string, however for the first non-blank row,
system detects it as numbers (different from the previous rows), hence system
will not store the fields and show it as Null.
This problem is caused by a
limitation of the Excel ISAM driver in that once it determines the datatype of
an Excel column, it will return a Null for any value that is not of the
datatype the ISAM driver has defaulted to for that Excel column. The Excel ISAM
driver determines the datatype of an Excel column by examining the actual
values in the first few rows and then chooses a datatype that represents the
majority of the values in its sampling. (http://support.microsoft.com/kb/194124)
Solution:
1) Add IMEX=1 into your excel connection
http://forums.asp.net/t/1802376.aspx/1
2) Try using .xlsx, it should work with Microsoft.ACE.OLEDB.12.0
3) If you are using .xls, try putting the non-blank values records first before the blank values records in the excel.
No comments:
Post a Comment