Question: how to export data from datatable to excel in asp.net?
Answer: First the DataTable will be populated with records from Database and then using the data from DataTable will be exported to Excel using ClosedXml library which is wrapper of OpenXml library. You can download the libraries using the following download locations.