You can use ClosedXML for this.
Store your table in a DataTable and you can export the table to excel by this simple snippet:
XLWorkbook workbook = new XLWorkbook();
DataTable table = GetYourTable();
workbook.Worksheets.Add(table );
You can read the documentation of ClosedXML to learn more. Hope this helps!