Reading Excel by OLEDB reads strings as DBNull

Posted by Sathish on Stack Overflow See other posts from Stack Overflow or by Sathish
Published on 2010-06-02T06:48:00Z Indexed on 2010/06/02 6:53 UTC
Read the original article Hit count: 187

Filed under:

I am reading Excel file using OLEDB in Csharp i have shown the sample excel data what i have

F1    F2    F3    F4
India 23    44    4
China 4     8     Month 6
USA   45    Neg   4

When i read this data and check in my DataTable i get Null values for "Month 6" and "Neg" where as i can be able get the F1 column correctly... my connection string is as shown

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=[XLSource];Extended Properties=Excel 12.0;

© Stack Overflow or respective owner

Related posts about c#