473,320 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using Excell in C# OleDbException on connection.Open

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????

--

Marc Miles
Nov 16 '05 #1
1 2088
I guess noone has a clue on what to do with this issue. Arggg.

--

Marc Miles
"milesm" <mi****@u.washington.edu> wrote in message
news:c5**********@nntp6.u.washington.edu...
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????

--

Marc Miles

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: milesm | last post by:
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...
1
by: yma | last post by:
Hi, I tried to use a listbox to display a column in MS Access 2000 nwind.mdb by using ole DataAdapter, Connection and dataset controls. But I got "It is already opened exclusively by another...
7
by: Jim McGivney | last post by:
ASPX page from VS.net-C# on host's computer using oleDataAdaptor to connect to Microsoft Access database. The page loads, but when connection to the database is attempted to fill a datagrid the...
1
by: jagdishl | last post by:
Hi: I have used the following code for my update query button I have used VB.Net Private Sub btncollections_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
1
by: alan | last post by:
I've use VB.NET+Access to write build a simple POS application. For example i got two computer, comp A and comp B. Which comp A share a Access db file through the network. When open a new bill, the...
5
by: Gene | last post by:
What can I do if I want to get the result using the sql command? for example, the select command is "select Name from Employee where StaffID=10" How to get the "Name"??? dim Name as string and...
9
by: Peter | last post by:
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the...
0
by: mkahn | last post by:
Fater leaving my computer for a few minutes. I tried to continue working with the page am on. Seems to be that after my connection timed out, am not able to reconnect to the data base getting the...
11
by: sweetpotatop | last post by:
Hi, I wonder if it is possible to read the content of an excel spreadsheet through aspnet. The spreadsheet (workbook) is protected and it resides in a network drive. Please provide sample...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.