473,378 Members | 1,507 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,378 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 2091
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...
1
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: 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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.