using IronXL;
using System;
using System.Data;
// Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
WorkBook workBook = WorkBook.Load("sample.xlsx");
// Select default sheet
WorkSheet workSheet = workBook.DefaultWorkSheet;
// Convert the worksheet to DataTable
DataTable dataTable = workSheet.ToDataTable(true);
// Enumerate by rows or columns first at your preference
foreach (DataRow row in dataTable.Rows)
{
for (int i = 0 ; i < dataTable.Columns.Count ; i++)
{
Console.Write(row[i]);
}
}
Imports IronXL
Imports System
Imports System.Data
' Supported for XLSX, XLS, XLSM, XLTX, CSV and TSV
Private workBook As WorkBook = WorkBook.Load("sample.xlsx")
' Select default sheet
Private workSheet As WorkSheet = workBook.DefaultWorkSheet
' Convert the worksheet to DataTable
Private dataTable As DataTable = workSheet.ToDataTable(True)
' Enumerate by rows or columns first at your preference
For Each row As DataRow In dataTable.Rows
For i As Integer = 0 To dataTable.Columns.Count - 1
Console.Write(row(i))
Next i
Next row