Hi,
My program exported a excel file by using
Context.Response.AddHeader("content-disposition", attachment)
Context.Response.ContentType ="application/vnd.ms-excel"
my excel file saved in webpage format, after downloading the same when i import it back to my system using Microsoft Excel driver, i got an error:
External table is not in the expected format.
Do anyone know how to solve it?
Expecting for your help very urgent
kalai
My Export Excel coding
" Dim form As New HtmlForm()
Dim attachment As String = "attachment; filename=Patients.xls"
Context.Response.ClearContent()
Context.Response.AddHeader("content-disposition", attachment)
Context.Response.ContentType = "application/ms-excel"
Dim stw As New StringWriter()
Dim htextw As New HtmlTextWriter(stw)
form.Controls.Add(GridView1)
Me.Controls.Add(form)
form.RenderControl(htextw)
Context.Response.Write(sb.ToString())"
MyConnection = New system.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\Users\develope\Downloads\Patients.xls; " & "Extended Properties=Excel 8.0;")
This is my connection string but i get same error
"External table is not in the expected format.