IronSoftware
  • Products
    for .NET Java Python
    Create, read, and edit PDFs
    for .NET
    Image to text in 127 languages
    for .NET
    Read and write QR & Barcodes
    for .NET
    Edit Excel & CSV Files.
    No Office Interop required
    for .NET
    Extract structured data from websites
    5 for the Price of 2 All 5 .NET product licenses from $1498 Save 60% with Iron Suite Iron Suites - Donate $50
  • Open Source
    for .NET
    System.Drawing.Common Replacement
    Free Software Development Tools
  • About Us

    Our Company

    • About Us 
    • Company News 
    • Environmental Commitments 
    • Beta Program 
    • Year in Review: 2022 

    Sales Partners

    • Global Resellers 

    Contact Us

    • Live Chat 
    • Send an Email 
    +1 (312) 500-3060
    205 N. Michigan Ave.
    Chicago, IL 60611, USA

    Careers at Iron

    Join our teamJoin our team
    We're hiring
  • Contact Us

205 N. Michigan Ave. Chicago, IL 60611, USA +1 (312) 500-3060

Join Iron Slack

  • Home
  • Licensing
  • EULA
  • Support & Update Extensions
  • License Upgrades
  • Start 30-Day Trial
  • Features
  • Get Started
  • Code Examples
  • Tutorials
  • How-Tos
  • Troubleshooting
  • Product Updates
  • API Reference
  • Search
  • Free NuGet Download
IronXL - Excel Library for C# .NET IronXL - Excel Library for C# .NET
  • Home
  • Licensing
    • Licensing
    • EULA
    • Support & Update Extensions
    • License Upgrades
    • Start 30-Day Trial
  • Features
  • Docs
    • Search
    • Get Started
    • Code Examples
    • Tutorials
    • How-Tos
    • Troubleshooting
    • Product Updates
    • API Reference
    • Search
  • Search CtrlK
  • Free NuGet Download Total downloads: 537,288
Message's icon
IronXL
IronXL
Iron Software Product Iron Software Documents

Search

CtrlK
  • Get Started
  • Code Examples
    • How to Read an Excel File in C#
    • Using C# to Create Excel Files in .NET
    • Use C# to Open & Write an Excel File
    • Compatibility
      • License Keys
      • Setup on macOS
      • Setup on AWS
      • Setup on Azure
      • Setup on Docker
      • Setup on Linux
      • Read Excel Files in Blazor
      • Work with Excel in C# without Interop
      • Work with VB.NET Excel Files
      • Work with Excel on .NET MAUI
    • Workbooks
      • Create Excel Documents in C#
      • Create an XLSX File
      • Parse Excel Files in C#
      • Read Excel File Example
      • Export to Excel in C#
      • Read XLSX File C#
      • Read a CSV in C#
      • Encrypt Workbook with Password
      • Read Excel Files in ASP.NET Web Apps
      • Write CSV in .NET
      • Open Excel Worksheets in C#
      • Convert a Data Table to CSV
      • Convert XLSX to CSV, JSON, XML
      • Convert Spreadsheet File Types
      • Manage Worksheet
      • Edit Workbook Metadata
    • Worksheets
      • Select Range
      • Freeze Panes
      • Encrypt Worksheet with Password
      • Add Rows and Columns
      • Autosize Rows and Columns
      • Add, Extract, and Remove Images
      • Group and Ungroup
      • Create Excel Charts in C#
    • Cell Ranges
      • Write Excel Values in .NET
      • Import Excel Data in C#
      • Sort Cell Range
      • Trim Cell Range
      • Merge and Unmerge Cells
      • Clear Cell
      • Copy Cell
      • Set Hyperlink
      • Math Functions
      • Cell Font and Size
      • Set Cell Data Formats
      • Cell Border & Alignment
      • Background Pattern & Color
      • Edit Excel Files in C#
    • Troubleshooting Guides
      • Apply a license key in IronXL
      • File Size Limits
    • Common Questions
      • IronXL - Security CVE
    • Changelog
    • Milestones
    • Milestones: Performance
  • API Reference
Free for development from NuGet

Install with NuGet nuget.org/packages/IronXL.Excel

PM > Install-Package IronXL.Excel

Create or Load Spreadsheets
Create a new Excel File Load Excel Files without Interop Load Excel From SQL Database
Save or Export Formats
Export Excel to CSV, XML, HTML, XLSX Convert Spreadsheet File Types Convert Excel to HTML
System.Data Objects
Excel to SQL via System.Data.DataSet Excel to SQL and DataGrid via DataTable Update Excel Database Records
Edit Workbooks
Edit Excel Metadata in C# Protect Excel Files Excel Print Setup
Edit Formulas
Excel Formulas in C#
Sort Data
Sort Excel Ranges in C# Select Excel Range
Create and Edit Charts
Create Excel Chart
Edit Layout
Freeze Panes in Excel Auto Adjust Rows & Columns Size
Edit Worksheets
Insert New Rows & Columns Group & Ungroup Rows & Columns Repeat Excel Rows & Columns Copy Excel Worksheets Add, Extract & Remove Worksheet Images
Cell Range Functions
Combine Excel Ranges
Style Cells
Style Excel Cell Borders & Fonts
Maths Functions
Aggregate Excel Functions
Set Cell Data Formats
Excel Number Format Excel Conditional Formatting

Update Excel Database Records

using IronXL;
using System.Data;
using System.Data.SqlClient;

// Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
WorkBook workBook = WorkBook.Load("sample.xlsx");

// Convert the workbook to ToDataSet
DataSet dataSet = workBook.ToDataSet();

// Your sql query
string sql = "SELECT * FROM Users";

// Your connection string
string connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=usersdb;Integrated Security=True";
using (SqlConnection connection = new SqlConnection(connectionString))
{
    // Open connections to the database
    connection.Open();
    SqlDataAdapter adapter = new SqlDataAdapter(sql, connection);

    // Update the values in database using the values in Excel
    adapter.Update(dataSet);
}
Imports IronXL
Imports System.Data
Imports System.Data.SqlClient

' Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
Private workBook As WorkBook = WorkBook.Load("sample.xlsx")

' Convert the workbook to ToDataSet
Private dataSet As DataSet = workBook.ToDataSet()

' Your sql query
Private sql As String = "SELECT * FROM Users"

' Your connection string
Private connectionString As String = "Data Source=.\SQLEXPRESS;Initial Catalog=usersdb;Integrated Security=True"
Using connection As New SqlConnection(connectionString)
	' Open connections to the database
	connection.Open()
	Dim adapter As New SqlDataAdapter(sql, connection)

	' Update the values in database using the values in Excel
	adapter.Update(dataSet)
End Using
Install-Package IronXL.Excel

Update Excel Database Records

Converting Excel WorkBook.ToDataSet() allows .NET developers to first manipulate the dataset, and then use it to update SQL records very easily using System.Data.

Related Docs Links

Ready to get started? Version: 2023.9 just released

Start for Free Total downloads: 537,288
Start for Free Total downloads: 537,288
View Licenses >
Try IronXL for Free
Get Set Up in 5 Minutes
C# NuGet Library for PDF
Install with NuGet
Version: 2023.9
Install-Package IronXL.Excel
nuget.org/packages/IronXL.Excel/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronXL"
  3. Select the package and install
C# PDF DLL
Download DLL
Version: 2023.9
Download Now
Manually install into your project
  1. Download and unzip IronXL to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronXL.dll"
Licenses from $749

Have a question? Get in touch with our development team.

15 1000 1
Now that you’ve downloaded IronXL
Want to deploy IronXL to a live project for FREE?
Not ready to buy?

Want to deploy IronXL to a live project for FREE?

What’s included?
30 days of fully-functional product
Test and share in a live environment
No restrictions in production
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:

badge_greencheck_in_yellowcircle

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Schedule a call
Have a question? Get in touch with our development team.
No credit card or account creation required
15 1000 1
Your Trial License Key has been emailed to you.
Not ready to buy?
Thank you.
View your license options:
Thank you.
If you'd like to speak to our licensing team:
View Licensing
Schedule a call
Have a question? Get in touch with our development team.
Have a question? Get in touch with our development team.
15 1000 1
Want to deploy IronXL to a live project for FREE?
Not ready to buy?

Want to deploy IronXL to a live project for FREE?

What’s included?
30 days of fully-functional product
Test and share in a live environment
No restrictions in production
Get your free 30-day Trial Key instantly.
Thank you.
If you'd like to speak to our licensing team:

badge_greencheck_in_yellowcircle

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Schedule a call
Have a question? Get in touch with our development team.
No credit card or account creation required
15 1000 1
Your Trial License Key has been emailed to you.
Not ready to buy?
Download IronXL free to apply
your Trial Licenses Key
Thank you.
If you'd like to speak to our licensing team:
Install with NuGet View Licensing
Schedule a call
Licenses from $749. Have a question? Get in touch.
Have a question? Get in touch with our development team.
ironxl_for_dotnet

Get started for FREE

No credit card required

Fully-functional product

Get 30 days of fully-functional product.
Have it up and running in minutes.

bullet_calendar

Test in a live environment

Test and share in a live environment.
Works wherever you need it to.

bullet_test

No watermarks

No watermarks in production.
No limits.

bullet_watermark
ironxl_for_dotnet

Get your free 30-day Trial Key instantly.

bullet_checkedNo credit card or account creation required

badge_greencheck_in_yellowcircle

The trial form was submitted
successfully.

Your trial key should be in the email.
If it is not, please contact
support@ironsoftware.com

Trusted by Over 2 Million Engineers Worldwide

  • aetna_logo
  • wwf_logo
  • nasa_logo
  • usda_logo
  • 3m_logo
  • tesla_logo
ironxl_for_dotnet

Get started for FREE

No credit card required

Fully-functional product

Get 30 days of fully-functional product.
Have it up and running in minutes.

bullet_calendar

Test in a live environment

Test and share in a live environment.
Works wherever you need it to.

bullet_test

No watermarks

No watermarks in production.
No limits.

bullet_watermark
ironxl_for_dotnet

Your Trial License Key has been emailed to you.

Install with NuGet
View Licensing

Licenses from $749. Have a question? Get in touch.

Trusted by Over 2 Million Engineers Worldwide

  • aetna_logo
  • wwf_logo
  • nasa_logo
  • usda_logo
  • 3m_logo
  • tesla_logo
Free 30-Day Trial Key Start for Free Start Free Trial Start Free 30-Day Trial Free 30-Day Trial Key Start for Free Start Free Trial Start Free 30-Day Trial

Fully-functional product, get the key instantly

IronXL for .NET

The Excel API you need, without the Office Interop hassle.

Search

CtrlK

Documentation

  • Code Examples
  • API Reference
  • How-Tos
  • Features
  • Blog
  • Credits
  • Product Brochure

Tutorials

  • Get Started
  • Read an Excel File in C#
  • Create Excel Files in .NET

Licensing

  • Buy a License
  • Support Extensions
  • Resellers
  • License Keys
  • EULA

Try IronXL Free

  • Download on NuGet
  • Download DLL

  • 30-Day Trial License

When you need your PDF to look like HTML, fast.

Tesseract 5 OCR in the languages you need, We support 127+.

When you need to read, write, and style, QR & Barcodes, fast.

The Excel API you need, without the Office Interop hassle.

The power you need to scrape & output clean, structured data.

The complete .NET Suite for your office.

  • IRONSUITE
  • |
  • IRONPDF
  • IRONOCR
  • IRONBARCODE
  • IRONXL
  • IRONWEBSCRAPER
IronSoftware
205 N. Michigan Ave. Chicago, IL 60611 USA +1 (312) 500-3060
  • About Us
  • News
  • Careers
  • Contact Us
  • Join Iron Slack

Supporting Teamseas

Copyright © Iron Software LLC 2013-2023

  • Terms
  • Privacy

Thank you!

Your license key has been delivered to the email provided. Contact us

24-Hour Upgrade Offer:

Save 50% on a
Professional Upgrade

Go Professional to cover 10 developers
and unlimited projects.

hours

:

minutes

:

seconds

Upgrade to Professional

Upgrade

Professional

$600 USD

$299 USD


  • 10 developers
  • 10 locations
  • 10 projects
TODAY ONLY
Iron Suite

5 .NET Products for the Price of 2

IronPDF IronOCR IronXL IronBarcode IronWebscraper

Total Suite Value:

$7,192 USD

Upgrade price

TODAY
ONLY

$499 USD

After 24 Hrs

$1,098 USD