IRONSOFTWAREHOME
通过System.Data.DataSet将Excel转换为SQL
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]);
        }
    }
}
Imports IronXL
Imports System
Imports System.Data

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

' Convert the whole Excel WorkBook to a DataSet
Dim dataSet As DataSet = workBook.ToDataSet()

For Each table As DataTable In dataSet.Tables
    Console.WriteLine(table.TableName)

    ' Enumerate by rows or columns first at your preference
    For Each row As DataRow In table.Rows
        For i As Integer = 0 To table.Columns.Count - 1
            Console.Write(row(i))
        Next
    Next
Next
NuGet Download
PM > Install-Package IronXL.Excel
通过System.Data.DataSet将Excel转换为SQL

通过System.Data.DataSet将Excel转换为SQL

在 GitHub 上查看

准备开始了吗?

Nuget Downloads 2,237,574版本:2026.9刚刚发布

Key in blue circle

立即获取免费的 30 天试用版密钥

Your trial license will be sent to your email address

无任何限制。100% 解锁。无需信用卡。

bullet_checked无需信用卡或创建账户无任何限制。100% 解锁。无需信用卡。
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
预约您的免费现场演示
Booking Badge

深受全球数百万工程师信赖

Iron Software 的客户徽标
获取您的无义务咨询
填写下面的表格或通过sales@ironsoftware.com
您的资料将始终保密。
深受全球数百万工程师信赖
Iron Software 的客户徽标
立即获取您的免费30 天试用密钥
无需信用卡或创建账户