Problem importing Excel with Ado.NET

  • Thread starter Thread starter Dinesh Upare
  • Start date Start date
D

Dinesh Upare

Friends,
I am trying to import a data from excel using ado.net
oledb provider.
The problem is the column has following data

MMNo
900
901
902
P900
P901
P902

When i import this data the result I get is-

MMNo
900
901
902
null
null
null

I thing only the numbers are being populated.Can any one
suggest me how to import the column data in excel which
has numbers as well as text.

When i define a named range for numbers and text data
seperately,then it works. But this is not a viable
solution.
If I use automation then aslo it works,even if but i
don't want to use automation.

Is this really possible using ADO.NET?

Any help appreciated.

Thanks

Dinesh
 
You need to provide an Extended Property: IMEX=1

There's another issue that's yet to be solved however, if
you provide a long numeric value, Excel likely will return
a number in scientific notation. I wish it doesn't do
this because this can sometimes truncate your numbers. Or
you'll need to try to parse it and it's a mess.
 
Back
Top