Excel vers SQL via System.Data.DataSet
using IronXL;
using System;
using System.Data;

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

// Convert the whole Excel WorkBook to a DataSet
DataSet dataSet = workBook.ToDataSet();

foreach (DataTable table in dataSet.Tables)
{
    Console.WriteLine(table.TableName);

    // Enumerate by rows or columns first at your preference
    foreach (DataRow row in table.Rows)
    {
        for (int i = 0 ; i < table.Columns.Count ; i++)
        {
            Console.Write(row[i]);
        }
    }
}
NuGet Download
PM > Install-Package IronXL.Excel
Excel vers SQL via System.Data.DataSet

Excel vers SQL via System.Data.DataSet

Convertissez tout fichier XLSX, XLS, XLSM, XLTX, CSV, et TSV en un fichier System.Data.DataTable pour une interopérabilité complète avec System.Data.SQL ou pour remplir un DataGrid. Cet objet DataTable peut contenir une collection de tables, de relations et de contraintes.

Learn how to export DataTables in C# with our guide.
Voir sur GitHub

Prêt à commencer?

Nuget Downloads 2,362,812Version :2026.11vient de sortir