Excel data mismatch

G

Guest

I am having a problem in reading the values from the excel sheet in ASP .Net.
I am using the following connection string to read values from rows from an
excel sheet into a dataset. One of the columns contains alpha-numeric values
i.e. ABCDE12345 When accessing the value of this cell it returns "" (empty
string).

I am using the following connection string:
string strConn="Provider=Microsoft.Jet.OLEDB.4.0;"+"Data
Source="+filepath+";"+"Extended Properties=Excel 8.0;";

I have tried adding combinations of the following also.
HDR=YES;IMEX=1;ImportMixedTypes=Text;

The exception I get after adding the above code with my above connection
string is "No installable ISAM".

Does anyone have experience with this problem?
 
M

Mark Rae [MVP]

I am using the following connection string:
string strConn="Provider=Microsoft.Jet.OLEDB.4.0;"+"Data
Source="+filepath+";"+"Extended Properties=Excel 8.0;";

I have tried adding combinations of the following also.
HDR=YES;IMEX=1;ImportMixedTypes=Text;

Extended properties need to be surround in quotes:

string strConn = "Provider=Microsoft.Jet.OleDB.4.0;" + "Data
"Source=" + filepath + ";" + "Extended Properties=\"Excel
8.0;HDR=YES;IMEX=1;ImportMixedTypes=Text \"";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top