473,386 Members | 1,715 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,386 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 2092
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: 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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.