|
Home > Code Samples > Export DataTable to Excel in VBExport DataTable to ExcelVB.Net Dim products as New DataTable ... Response.Clear() Response.ClearHeaders() Dim writer As New CsvWriter(Response.OutputStream, ","c, Encoding.Default) writer.WriteAll(products, True) writer.Close() Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("Content-Disposition", "attachment; filename=products.csv") Response.End() |
||||||||||||||||
|