Export DataSet to Excel file in .NET

EasyXLS™ library allows you to export a DataSet to an Excel file. The data in cells can be formatted using predefined formats or user-defined formats.

EasyXLS can be successfully used inclusively to export large Excel files having big volume of data with fast exporting time.

The source code samples can be integrated in:
- ASP.NET web pages
- Windows applications
- Windows Forms (WinForms)
- Console applications
- Windows service applications
- ASP.NET MVC web applications

EasyXLS permits you to export Excel files without Excel installed, without Interop or any other additional software installed.

Source code sample

The below example shows how to export DataSet to Excel in C#, VB.NET, C++.NET and J#.


The screen shot below provides an example of exported data to Excel file from a DataSet.

Exported data to Excel file from DataSet

Formatting cells

EasyXLS™ enables you to format cells, rows and columns in order to set the fonts and colors.

Export DataSet to XLSX, XLSB, XLSM and XLS files

This code sample shows how to export a DataSet to XLSX file. Similarly, you can export a DataSet to XLS file using ExcelDocument.easy_WriteXLSFile_FromDataSet method or export DataSet to XLSB file using ExcelDocument.easy_WriteXLSBFile_FromDataSet method.

Export DataSet to Excel file with multiple sheets

EasyXLS offers the option to insert multiple DataSets into one worksheet or into multiple worksheets. The DataSet can be added into a specified worksheet. The column names of the DataSet can be optionally included.

The below source code sample shows how to add a DataSet with a nice formatting into an Excel file with two worksheets


Getting started with EasyXLS Excel library

To download the trial version of EasyXLS Excel Library, press the below button:

Download EasyXLS™ Excel Library for ASP.NET

If you already own a license key, you may login and download EasyXLS from your account.

After installation, you will need to create a C#, VB.NET, C++.NET or J# project and add a reference to EasyXLS.dll.

Available for: Professional, Excel Writer, Express Excel Writer
Go to top

EasyXLS Excel libraries:

.NET Excel Library
full .NET version to import, export or convert Excel files
.NET Excel Writer
.NET version to create and export Excel files
.NET Express Excel Writer
limited .NET version to create and export Excel files in predefined formats
Download EasyXLS™ Excel Library for .NET

File formats:

Office 365
MS Excel 2021 - 2024
MS Excel 2007 - 2019
MS Excel 97 - 2003