Question: how to export gridview data into excel in 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()