Question: how to export data into excel from datatable in c#?
Answer: Try simple code, to convert DataTable to excel file as csv: var lines = new List<string>(); string[] columnNames = dataTable. Columns . Cast<DataColumn>() .