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=Microsoft.Jet.OLEDB.4.0; Data Source=" + file + "; Extended
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
|All times are GMT. The time now is 04:49 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.