Using Excell in C# OleDbException on connection.Open

  • Thread starter Thread starter milesm
  • Start date Start date
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

delete in c# .net 1
datatable 4
Read integer value from Excel file failed 4
Da.fill(ds); --error 7
Connections when reading excel into dataset 1
Fill error in dataset 3
excel read file 1
DataGrid.Datasource 1

Back
Top