Excel para 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 para SQL via System.Data.DataSet

Excel para SQL via System.Data.DataSet

Converta qualquer arquivo XLSX, XLS, XLSM, XLTX, CSV, e TSV em um System.Data.DataTable para total interoperabilidade com System.Data.SQL ou para preencher um DataGrid. Este objeto DataTable pode conter uma coleção de tabelas, relacionamentos e restrições.

Learn how to export DataTables in C# with our guide.
Ver no GitHub

Pronto para começar?

Nuget Downloads 2,362,812Versão:2026.11recém-lançado