Using Excell in C# OleDbException on connection.Open

M

milesm

I have the following error that errors on "conn.Open()".....
An unhandled exception of type 'System.Data.OleDb.OleDbException'
occurred in system.data.dll

CODE
//set the data file to be read from
string workbook = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=postingReport.xls;Extended Properties=Excel 8.0;";
//load workbook into dataSet
OleDbConnection conn = new OleDbConnection(workbook);
conn.Open();
OleDbDataAdapter da = new OleDbDataAdapter("Select * From
[postingReport$]", conn);
DataSet ds = new DataSet();
da.Fill(ds);
conn.Close();


Win2k, Framework 1.1, Logged in with account that has full admin
rights. I've also tried "HDR=No;" in the conn string.............Any
suggestions????
 

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

Similar Threads


Top