trouble reading excel with ado.net

G

Guest

Here is the code that's giving me trouble:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Development\\CPRUtilities\\SeamusFile.xls" +
"Extended Properties=Excel 8.0;HDR=YES;";
OleDbConnection connection = new OleDbConnection(connString);

DataSet ds = new DataSet();
OleDbDataAdapter command = new OleDbDataAdapter("Select * from
[NonWeiss$]",connection);
connection.Open();

try
{
command.Fill(ds);
}
catch (Exception ex)
{
}
 
N

Norman Yuan

Is it for web app or Windows app?

If the connection string in your post is directly copied from your code,
then you probably missed a ";" between the end of *.xls file name and
"Extended...".

Tarab H said:
Here is the code that's giving me trouble:

string connString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Development\\CPRUtilities\\SeamusFile.xls" +
"Extended Properties=Excel 8.0;HDR=YES;";
OleDbConnection connection = new OleDbConnection(connString);

DataSet ds = new DataSet();
OleDbDataAdapter command = new OleDbDataAdapter("Select * from
[NonWeiss$]",connection);
connection.Open();

try
{
command.Fill(ds);
}
catch (Exception ex)
{
}

Tarab H said:
Whenever I try to read an excel sheet using ado.net, I keep getting this error

"Could not find installable ISAM. "

I tried what microsoft had to say on this link
http://support.microsoft.com/?scid=kb;EN-US;209805 but the problem still
persists.

Does anyone have any idea why?
 

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

Top