tags:

views:

905

answers:

2

I need to Export DataSet to Excel, Exporting it is not the main issue, When I am using the Same Exported Excel File using following Connection String CS = "provider=Microsoft.Jet.OLEDB.4.0; " & _ "data source=" + FilePath + ";Extended Properties=Excel 8.0;"

It gives me an error message saying External Table is not in correct format

Help Needed

+1  A: 

You can do this in a better way by changing the Response.ContentType "application/vnd.ms-excel", especially since you are using ASP.NET and not winforms.

check this article with full details on converting dataset to excel

Binoj Antony
A: 

When you do Response.ContentType "application/vnd.ms-excel".
You can just generate an html table.
Excel will pick it op an open it and automatically convert the HTML to excel.

Julian de Wit