Biblioteca de hojas de cálculo de Excel de IronXL para C# .NET

Cómo leer datos de Excel en C#

  1. Leer datos o Excel Tutorial
  2. lector de Excel en C# para desarrolladores C#
  3. Biblioteca de Excel confiable en C#

O descarga el DLL directamente aquí

Leer archivos de Excel sin Interop
Ver Todos los Ejemplos de Código %s
using IronXL;
using System;
using System.Linq;

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

// Select worksheet at index 0
WorkSheet workSheet = workBook.WorkSheets[0];

// Get any existing worksheet
WorkSheet firstSheet = workBook.DefaultWorkSheet;

// Select a cell and return the converted value
int cellValue = workSheet["A2"].IntValue;

// Read from ranges of cells elegantly.
foreach (var cell in workSheet["A2:A10"])
{
    Console.WriteLine("Cell {0} has value '{1}'", cell.AddressString, cell.Text);
}

// Calculate aggregate values such as Min, Max and Sum
decimal sum = workSheet["A2:A10"].Sum();

// Linq compatible
decimal max = workSheet["A2:A10"].Max(c => c.DecimalValue);
NuGet Downloads Badge
PM >Install-Package IronXL.Excel
Explora el código y ejecútalo para ver los PDFs de muestra