Net4x.DapperLibrary.OleDb
1.9.9.8
dotnet add package Net4x.DapperLibrary.OleDb --version 1.9.9.8
NuGet\Install-Package Net4x.DapperLibrary.OleDb -Version 1.9.9.8
<PackageReference Include="Net4x.DapperLibrary.OleDb" Version="1.9.9.8" />
<PackageVersion Include="Net4x.DapperLibrary.OleDb" Version="1.9.9.8" />
<PackageReference Include="Net4x.DapperLibrary.OleDb" />
paket add Net4x.DapperLibrary.OleDb --version 1.9.9.8
#r "nuget: Net4x.DapperLibrary.OleDb, 1.9.9.8"
#:package Net4x.DapperLibrary.OleDb@1.9.9.8
#addin nuget:?package=Net4x.DapperLibrary.OleDb&version=1.9.9.8
#tool nuget:?package=Net4x.DapperLibrary.OleDb&version=1.9.9.8
DapperLibrary.OleDb
OLE DB provider integration for DapperLibrary. This project supplies an OLE DB-specific DapperContext implementation, a provider factory and database model/type mappings suitable for ADO.NET OLE DB providers.
Purpose
Provide OLE DB engine-specific behavior while preserving the common DapperLibrary API. The assembly includes:
OleDbDapperContext� aDapperContextconfigured for OLE DB and wired to configuration viaDapperConfigurationManager.OleDbProviderFactory� configures parameter handling, data adapter event forwarding and command parameter preparation tailored for OLE DB semantics.OleDbDatabaseModel,OleDbDatabaseModelTypesandOleDbDatabaseEnumTypes� identifier delimiters, statement terminator, parameter naming and provider-specific type/string mappings.
Key types
OleDbDapperContext- Derives from
DapperContextand is initialized withOleDbProviderFactoryand aDapperConfigurationManagerthat targets theSystem.Data.OleDbnamespace. - Constructors accept an
IConfigurationinstance to pull connection strings and other configuration values.
- Derives from
OleDbProviderFactory- Inherits from
ProviderFactoryBaseand delegates toOleDbFactory.Instance. - Uses
ParameterModel.ParameterPrefix = "?"andParameterModel.AddIndex = falseto match OLE DB parameter conventions (unnamed positional parameters commonly represented as?). - Sets
AddPrefixInParameterName = falseand provides aPrepareCommandParametersimplementation that createsDbParameterobjects, injects them into the command and formats the command text by replacing placeholders with parameter names. - Attaches to
RowUpdated/RowUpdatingevents on theOleDbDataAdapterand forwards them via the provider factory.
- Inherits from
OleDbDatabaseModeland related types- Identifier delimiters:
[and]. - Batch terminator:
;. - Parameter prefix:
?and parameter base name:Par. - Type mapping strings are built around
System.Data.OleDb.OleDbTypenames (for exampleInteger,BigInt,LongVarBinary,VarChar({0}), etc.).
- Identifier delimiters:
Usage examples
Create and use an OleDbDapperContext:
var configuration = /* IConfiguration with connection strings */;
using var context = new OleDbDapperContext(configuration);
// use context.Operations / context.Schema / context.SaveDataTable etc.
The OleDbProviderFactory prepares command parameters by creating DbParameter instances and formatting the command text using parameter names (the provider uses positional ? parameters, so AddIndex is false by default in this factory).
Parameter conventions
- OLE DB typically uses positional
?parameters. The provider factory setsParameterPrefixto?and does not add an index to parameter names by default (AddIndex = false). PrepareCommandParametersbuilds parameters and then replaces indexed placeholders in the SQL command with the parameter names. This keeps parameter handling consistent with other providers in the DapperLibraries while accommodating OLE DB conventions.
Example of how values are bound in the provider:
- For a statement with placeholders like
{0},{1}, the factory will create parameters, add them to the command and then format the command text using the actual parameter names so the provider receives a command with?-style parameters.
Multi-targeting & compatibility
- The project is intended to be usable on older .NET Framework targets (the solution contains many multi-targeted projects). The OLE DB provider types (
System.Data.OleDb) are available in .NET Framework; when targeting .NET Core/.NET 5+ consider using ODBC or provider-specific clients if native OLE DB support isn't available for your runtime. - The code contains conditional compilation in related projects across the solution to produce framework-specific binaries.
Synchronous vs asynchronous behavior
- OLE DB ADO.NET implementations traditionally have limited or no asynchronous I/O support. DapperLibrary exposes both synchronous and asynchronous APIs, but on platforms/providers without true asynchronous support the
Async-suffixed methods may execute synchronously under the hood or use provider-specific async shims. - Prefer synchronous APIs when targeting runtimes where the underlying OLE DB implementation lacks proper async support. Use async APIs in environments where the provider supports non-blocking I/O and you need to avoid blocking threads.
Events and adapter behavior
OleDbProviderFactory.CreateDataAdapterattachesRowUpdatingandRowUpdatedevent handlers and forwards these events via the provider factory. Consumers usingDbDataAdapter-based save operations can subscribe to these events to customize row-level update behavior.
Notes and best practices
- Because OLE DB commonly uses positional parameters, avoid relying on named-parameter semantics when building raw SQL for OLE DB providers; rely on the
PrepareCommandParametersconventions implemented by the provider factory instead. - For new applications on modern .NET runtimes, consider provider choices (ODBC, native client libraries) if OLE DB provider support is limited on your target platform.
- Use the
WithConnectionoverloads on DapperLibrary APIs to target specific named connections for single calls to avoid shared-state contention aroundConnectionStringToRead.
For implementation details review OleDbProviderFactory, OleDbDapperContext and the DbContexts types in this project.
| Product | Versions 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 | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 3.5
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
-
.NETFramework 4.0
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
-
.NETFramework 4.5
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
-
.NETFramework 4.6.1
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Configuration.ConfigurationManager (>= 9.0.0)
-
.NETStandard 2.1
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Configuration.ConfigurationManager (>= 9.0.0)
- System.Data.OleDb (>= 7.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Net4x.DapperLibrary.OleDb:
| Package | Downloads |
|---|---|
|
Net4x.Xsd2Db.Data
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.9.8 | 141 | 2/2/2026 |
| 1.9.9.7 | 139 | 1/13/2026 |
| 1.9.9.6 | 136 | 1/6/2026 |
| 1.9.9.5 | 134 | 1/6/2026 |
| 1.9.9.4 | 136 | 1/6/2026 |
| 1.9.9.3 | 140 | 1/5/2026 |
| 1.9.9.2 | 136 | 12/30/2025 |
| 1.9.9.1 | 138 | 12/30/2025 |
| 1.9.9 | 223 | 12/22/2025 |
| 1.6.0.12 | 169 | 12/12/2025 |
| 1.6.0.11 | 186 | 12/12/2025 |
| 1.6.0.10 | 484 | 12/9/2025 |
| 1.6.0.9 | 252 | 12/4/2025 |
| 1.6.0.8 | 253 | 12/4/2025 |
| 1.6.0.7 | 320 | 11/30/2025 |
| 1.6.0.6 | 230 | 11/27/2025 |
| 1.6.0.5 | 293 | 11/22/2025 |
| 1.6.0.4 | 195 | 11/16/2025 |
| 1.6.0.3 | 235 | 11/15/2025 |
| 1.6.0.2 | 316 | 11/14/2025 |