1

I am reading a xls file using OLEDB connection string

mCon.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;data source=" + mstrFilePath + ";Extended Properties=\"Excel 12.0 Xml;HDR=NO;IMEX=1\"");

I have deliberately set IMEX = 1, so that i can read all values as text as my xls sheet contains mix data type.

Now in xls sheet there is columns that contains exponential values eg 4.0416E+14 which has internal value 404160301389870. Now the problem is when i read the xls, it reads the exponential values instead of internal value, thus causing lose of data. How can i solve this problem. Please suggest !!!

Rajeev Kumar
  • 4,901
  • 8
  • 48
  • 83
  • 1
    [How to read internal value from Excel](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=c%23%20how%20to%20read%20internal%20value%20from%20excel%20cell) – MethodMan Nov 04 '14 at 05:21
  • You have to edit the excel only. What you can do is: Select Column or cell > FormatCells > Select Custom > and Type: enter 14 zeroes as you have 14 digits. – Paresh J Nov 04 '14 at 05:47
  • Try this [Scientific notation when importing from Excel in .Net](https://stackoverflow.com/questions/429853/scientific-notation-when-importing-from-excel-in-net) – Francisco Boullosa Aug 28 '19 at 21:16

0 Answers0