Linger.DataAccess.SqlServer
0.9.1-preview
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.7.2
This package targets .NET Framework 4.7.2. The package is compatible with this framework or higher.
This is a prerelease version of Linger.DataAccess.SqlServer.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Linger.DataAccess.SqlServer --version 0.9.1-preview
NuGet\Install-Package Linger.DataAccess.SqlServer -Version 0.9.1-preview
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="Linger.DataAccess.SqlServer" Version="0.9.1-preview" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Linger.DataAccess.SqlServer" Version="0.9.1-preview" />
<PackageReference Include="Linger.DataAccess.SqlServer" />
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 Linger.DataAccess.SqlServer --version 0.9.1-preview
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Linger.DataAccess.SqlServer, 0.9.1-preview"
#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 Linger.DataAccess.SqlServer@0.9.1-preview
#: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=Linger.DataAccess.SqlServer&version=0.9.1-preview&prerelease
#tool nuget:?package=Linger.DataAccess.SqlServer&version=0.9.1-preview&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Linger.DataAccess.SqlServer
SQL Server data access library with high-performance bulk operations.
Features
- High-performance bulk insert using SqlBulkCopy
- Async/await support
- Parameter validation with meaningful error messages
- Thread-safe operations
- Full compatibility with Linger.DataAccess framework
Installation
<PackageReference Include="Linger.DataAccess.SqlServer" Version="0.8.0-preview" />
Basic Usage
using Linger.DataAccess.SqlServer;
var connectionString = "Data Source=localhost;Initial Catalog=MyDB;User ID=xxxx;Password=xxxx;TrustServerCertificate=true";
var sqlHelper = new SqlServerHelper(connectionString);
// Bulk insert
var dataTable = GetDataTable();
await sqlHelper.AddByBulkCopyAsync(dataTable, "Users", batchSize: 2000, timeout: 120);
// ID generation
var nextId = await sqlHelper.GetMaxIdAsync("UserId", "Users");
// Data existence check
var hasData = await sqlHelper.ExistsAsync("SELECT COUNT(*) FROM Users WHERE Age > 18");
Core Methods
AddByBulkCopyAsync
public async Task AddByBulkCopyAsync(DataTable table, string tableName,
int batchSize = 1000, int timeout = 100, CancellationToken cancellationToken = default)
High-performance bulk data insertion.
GetMaxIdAsync
public async Task<int?> GetMaxIdAsync(string fieldName, string tableName,
CancellationToken cancellationToken = default)
Gets the maximum value of specified field plus 1 for ID generation.
ExistsAsync
public async Task<bool> ExistsAsync(string strSql, CancellationToken cancellationToken = default)
Checks if specified SQL query returns data.
Best Practices
- Use
AddByBulkCopy
for large datasets (> 1000 rows) - Adjust
batchSize
based on memory constraints - Use async methods for I/O intensive operations
- All methods are thread-safe
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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 is compatible. 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 is compatible. 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 Framework | net472 is compatible. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- Linger.DataAccess (>= 0.9.1-preview)
- Microsoft.Data.SqlClient (>= 6.1.1)
-
net10.0
- Linger.DataAccess (>= 0.9.1-preview)
- Microsoft.Data.SqlClient (>= 6.1.1)
-
net8.0
- Linger.DataAccess (>= 0.9.1-preview)
- Microsoft.Data.SqlClient (>= 6.1.1)
-
net9.0
- Linger.DataAccess (>= 0.9.1-preview)
- Microsoft.Data.SqlClient (>= 6.1.1)
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 |
---|---|---|
0.9.5 | 112 | 9/28/2025 |
0.9.4-preview | 163 | 9/25/2025 |
0.9.3-preview | 177 | 9/22/2025 |
0.9.2-preview | 187 | 9/21/2025 |
0.9.1-preview | 294 | 9/16/2025 |
0.9.0-preview | 115 | 9/12/2025 |
0.8.5-preview | 174 | 8/31/2025 |
0.8.4-preview | 296 | 8/25/2025 |
0.8.3-preview | 159 | 8/20/2025 |
0.8.2-preview | 194 | 8/4/2025 |
0.8.1-preview | 129 | 7/30/2025 |
0.1.2-alpha | 121 | 12/17/2024 |
0.1.1-alpha | 112 | 12/17/2024 |
0.1.0-alpha | 116 | 12/6/2024 |
0.0.3-alpha | 103 | 12/6/2024 |
0.0.2-alpha | 111 | 10/3/2024 |