Net4x.DapperLibrary.Excel 1.9.9.26271

dotnet add package Net4x.DapperLibrary.Excel --version 1.9.9.26271
                    
NuGet\Install-Package Net4x.DapperLibrary.Excel -Version 1.9.9.26271
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Net4x.DapperLibrary.Excel" Version="1.9.9.26271" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.DapperLibrary.Excel" Version="1.9.9.26271" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.DapperLibrary.Excel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Net4x.DapperLibrary.Excel --version 1.9.9.26271
                    
#r "nuget: Net4x.DapperLibrary.Excel, 1.9.9.26271"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Net4x.DapperLibrary.Excel@1.9.9.26271
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Net4x.DapperLibrary.Excel&version=1.9.9.26271
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.DapperLibrary.Excel&version=1.9.9.26271
                    
Install as a Cake Tool

DapperLibrary.Excel

DapperLibrary provider for Excel workbooks — .xlsx and .xls — over the fully managed Isam.Data.IsamClient ADO.NET provider and its Excel format (NPOI). No Jet, ACE, OLE DB, ODBC, and no Excel installation.

Built on Net4x.DapperLibrary.Isam, which serves the other ISAM formats (Text, dBASE, FoxPro, HTML, Lotus).

Types

Type Role
ExcelDapperContext An IsamDapperContext for a workbook: ForWorkbook / ForDirectory write its connection string, Use() / UseOnce() / UseWorkbook() register it with DapperContextFactory.Instance. Its static constructor registers the Excel format
ExcelProviderFactory IsamProviderFactory with the workbook dialect
ExcelDatabaseModel, ExcelDatabaseModelTypes The ISAM dialect with the type map a cell can actually hold
ExcelConnectionExtension.ToExcelDapperContext() Context over a caller-owned IsamConnection

Usage

Data Source is a workbook file, or a directory of them; its tables are the worksheets (Sheet1$), ranges (Sheet1$A1:C10) and named ranges.

Name the workbook and the context writes the connection string, taking the ISAM name from the extension:

using var book  = ExcelDapperContext.ForWorkbook(@"C:\Data\book.xlsx");   // Excel 12.0 Xml
using var old   = ExcelDapperContext.ForWorkbook(@"C:\Data\book.xls");    // Excel 8.0
using var books = ExcelDapperContext.ForDirectory(@"C:\Data\Books");

var rows = book.Operations.GetDataTable("SELECT * FROM [Sheet1$]");

ForWorkbook(file, isamName, headerRow, configure) overrides any of it, UseWorkbook(...) registers the context with the factory, and ConnectionStringFor(...) returns just the string. Or bring your own:

ExcelDapperContext.Use(
    @"Data Source=C:\Data\book.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES""",
    "Isam.Data.IsamClient");
using var context = DapperContextFactory.Instance.CreateDapperContext();

// or around an existing connection
using var connection = new IsamConnection(@"Data Source=C:\Data\book.xls;Extended Properties=""Excel 8.0;HDR=YES""");
using var context2 = connection.ToExcelDapperContext();
Workbook Extended Properties Inferred from
.xlsx Excel 12.0 Xml;HDR=YES any extension but .xls, and a directory
.xls Excel 8.0;HDR=YES the .xls extension

HDR says whether the first row holds column names; IMEX=1 reads every column as text, and TypeGuessRows sets how many rows are sniffed to infer a column's type.

The method is ToExcelDapperContext, not ToDapperContext: the receiver is IsamConnection, which DapperLibrary.Isam already extends with ToDapperContext, and one name over one receiver in two namespaces would be ambiguous.

Dialect

The same Jet SQL as DapperLibrary.Isam — [ … ], @Par0, #yyyy-MM-dd HH:mm:ss#, Max 255, IdentityInitializer null — with the type map narrowed to what a cell holds.

CLR type Column Why
long DECIMAL(19,0) a DECIMAL column reads back as a decimal; a BIGINT one comes back as the cell's raw double. Fifteen significant digits either way
short, sbyte, byte INTEGER a cell cannot hold a narrower number; INTEGER is the narrowest read back as an integer
float DOUBLE a cell holds a double either way
Guid CHAR(36) no GUID cell; the 36-character text is exact

Limits

  • A cell's number carries fifteen significant digits - narrower than the double it travels as. A sixteen-digit integer comes back rounded (4503599627370496 reads back 4503599627370500) whatever column it went into: the limit is the cell's, not the column's.
  • Binary, VarBinary, Image and Variant have no cell representation — keep bytes out of a workbook.
  • A sheet with formulas or merged cells is read-only; a formula cell reads back its cached result.
  • Excel has no date before 1900.
  • A worksheet is listed with a trailing $ (TestTable$), so match on the bare name when reading Schema.TableNames.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.9.26271 114 9/28/2026