Hi
I was able to read the excel with oledbconnection and was getting in a datatable form.
But when I am trying to use a excel which is downloaded from web application from gridview then its not able to read it, throwing error "External table is not in the expected format."
Please help me on this as I am stuck here,not able to move further.
Regards
Rohan
Candy BrownPosted Dec 3, 2014, 4:34 AM
Hi, are you sure you have an XLS format, you know there is a commonly used workaround for generating an excel file on a server side in which you actually create a HTML formatted file and rename it into an XLS extension and MS Excel will be able to read them. To add just in case, for XLS format you need Microsoft.Jet.OLEDB.4.0, while for an XLSX file you need Microsoft.ACE.OLEDB.12.0.
Any way you can try some other approach, see here how you can read your excel files in C# on the server side and a rather simple way how you can export that excel to a DataTable instance.
Rohan GuptaPosted Sep 11, 2014, 3:45 AM
Rohan GuptaPosted Sep 11, 2014, 1:00 AM
Nitesh KejriwalPosted Sep 10, 2014, 12:00 PM
Ramesh MaruthiPosted Sep 10, 2014, 11:11 AM
so when your downloading the file from web application what format does the download file has ?