EasyXLS Excel library is your key!
The DataTable can be the result of a SQL query or the data source for a GridView, DataGridView and DataGrid.
Export SQL query to Excel file
The result of a SQL query can be instantly exported to Excel with one line of code using EasyXLS Excel library. See more details about how to export DataSet to Excel.
Export GridView to Excel file
If the data source of the GridView is a DataTable and the intention is to export simply the data contained by the DataTable, see more details about how to export DataTable to Excel. If you want to export also the GridView formatting to Excel, check how to export GridView to Excel.
Export DataGridView to Excel file
If the data source of the DataGridView is a DataTable and the intention is to export simply the data contained by the DataTable, see more details about how to export DataTable to Excel. If you want to export also the DataGridView formatting to Excel, check how to export DataGridView to Excel.
Export DataGrid to Excel file
If the data source of the DataGrid is a DataTable and the intention is to export simply the data contained by the DataTable, see more details about how to export DataTable to Excel. If you want to export also the DataGrid formatting to Excel, check how to export DataGrid to Excel.