Here Mudassar Ahmed Khan has explained how to export ASP.Net GridView data to Excel file and then sending it as file attachment in email without saving the exporting Excel file on disk.
The GridView data will be first fetched into a DataTable and then the DataTable will be exported into an Excel Sheet using OpenXml and ClosedXml Excel libraries.
↧