473,602 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GridView to Excel then Excel to database table.

Has anyone else tried to save a GridView as a excel file and then use
ado.net to read the excel sheet back into a database table?

I'm having a terrible time trying to make this work. The normal method
of doing this using OleDb and a connection string like the following
doesn't work on a Excel file that has been created from a GridView.

Provider=Micros oft.Jet.OLEDB.4 .0; Data Source=" + file + "; Extended
Properties=\"Ex cel 8.0;HDR=Yes;IME X=1\"";

When doing this ado.net throws the following error.

"External table is not in the expected format."

I did a little research and found that the Excel sheet is in the
format of a html table which this connection string won't work with. I
then found another post where someone was using "Extended
Properties=HTML Import" but when I use this I get a different error.

"The Microsoft Jet database engine could not find the object
'Sheet1$'. Make sure the object exists and that you spell its name
and the path name correctly."

So I'm now stuck and can't make this work. Any idea's would be greatly
appreciated.

Thanks.

Nov 6 '07 #1
0 1584

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

Similar topics

1
1651
by: Andrew Nav | last post by:
I dragged a table from a datasource on to my web form and the GridView cpntrol was created. I turned on paging, and Edit and Delete buttons. I ran the app and everything worked great - not a single line of code written yet. Then I wanted to add a simple feature where the user could filter out data based on a value in a single column. I added a little code that set the FilterExpression property of the SqlDataSource, and that seemed...
0
1233
by: Peter | last post by:
I experienced a bug, "Control GridView1 of type GridView myst be placed inside a form tag with runat=server". But I did so. I do not why, please advise. my code as below. Thanks. Peter <%@ Page language="C#" %> <script runat="server"> protected void Page_Load(object sender, EventArgs e) {
3
2533
by: Daves | last post by:
hi, exporting GridView data to Excel is no problem but in the first data row I would like to put some descriptive information for the table. I cannot see any way to add this directly to the GridView so is there any way to add it to the final html table (guess I need to insert a <tr><td colspan=x ...) before sending it to Response? thx
1
1091
by: R.A.M. | last post by:
Hi, I am learning ASP.NET and I need to have an Excel-like sheet of records from database. Users may modify data in the sheet. I thought about using GridView with DataSource but the problem is that the changes should be transferred to database not when record is modified but when separate button is clicked (then a transaction with inserts/updates/deletes should be performed). As I understand database commands of DataSource are executed...
2
2850
by: Steve Kershaw | last post by:
Hi, I'm working on a project in which I have a Gridview that has data. That Gridview data must be then exported to an Excel spreadsheet. I have successfully displayed the Excel spreadsheet and fill it with data using the Range.InvokeMember(...) method: Range range2 = worksheet.get_Range("A1", "L1"); Object args2 = new Object;
1
3360
by: edwinparker | last post by:
Hi, I'm trying to convert a gridview to an excel report and have one small hang up. So far I've been able to create my gridview and export it to excel ok, but in my gridview I have an image. The problem is, the image won't display unless I'm connected to the Internet or if I use a relative path and have the image stored relative to the excel file. Is it possible to "embed" the image from the gridview into the excel workbook so I could give...
1
3387
by: Yordan Georgiev | last post by:
I have a search form using master page , which is dynamically generated from the column names of the database - when the users have a search result it should be exported to Excel by clicking the button ... I get the following message : A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in...
3
5196
by: ulai | last post by:
Thanks for your help. It really help to solve my work. But now i have a bigger problem : I had more than 65535 records in gridview divide by 10/pages. And when i tried to export the gridview in excel on every way : 1. I disabled the allowpaging in gridview and got and error messages like : System.OutOfMemoryException Was Thrown 2. My idea is to store row in gridview to virtable per pages. I create virtable as Table. Added row to virtable...
0
1910
by: hiranmaie | last post by:
Hi, I have a gridview with more than 10 rows of data. I want to export these gridview values into an excel sheet along with the header names of excel sheet. I am not using a database here. I need to open an excel application at the click of a button and save the gridview values into the excel sheet opened. Please help me out to solve this problem. Thanks & Regards,
0
7993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8404
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.