Question: how to export datatable data 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.