Question: how to export data in excel from gridview vb.net?
Answer: Protected Sub ExportToExcel(sender As Object, e As EventArgs) Response.Clear() Response.Buffer = True. Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.xls") Response.Charset = "" Response.ContentType = "application/vnd.ms-excel" Using sw As New StringWriter()