Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView to Excel then Excel to database table.

Thread Tools

GridView to Excel then Excel to database table.
Posts: n/a
Has anyone else tried to save a GridView as a excel file and then use 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=Microsoft.Jet.OLEDB.4.0; Data Source=" + file + "; Extended
Properties=\"Excel 8.0;HDR=Yes;IMEX=1\"";

When doing this 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


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase Computer Information 0 09-26-2012 09:40 AM
Help. SessionID is x then y then x then y ASP General 0 09-03-2005 03:02 PM
exporting an excel file from database; making changes to excel file and updating the database by importing it back Luis Esteban Valencia ASP .Net 1 01-12-2005 12:28 AM
Passing database info to page allow user input then pass into another database Renie83 ASP General 2 07-14-2003 05:30 PM