Click here to Skip to main content
15,947,958 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am trying to export EXCEL file using
Response.ContentType = "application/vnd.ms-excel";


But when i import same file to system using oledb it throws an error which reads.

External table is not in the expected
format.System.Data.OleDb.OleDbException: External table is not in the
expected format. at System.Data.OleDb.OleDbConnection.ProcessResults(Int32
hr) at System.Data.OleDb.OleDbConnection.InitializeProvider() at
System.Data.OleDb.OleDbConnection.Open()


How to solve this ?
any help ?
Posted
Updated 20-Jun-11 0:24am
v2

I am not very sure, but you may try with putting the columns names in excel sheet as same as that of the Grid from which you are exporting. I think I had encountered the same error sometime back and solved it the same way.
 
Share this answer
 
Hope C# class library for exporting data to CSV/Excel file[^]an article from CP might help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900