Wb.DataAccess.Bulk 1.2.2

dotnet add package Wb.DataAccess.Bulk --version 1.2.2
                    
NuGet\Install-Package Wb.DataAccess.Bulk -Version 1.2.2
                    
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="Wb.DataAccess.Bulk" Version="1.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wb.DataAccess.Bulk" Version="1.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Wb.DataAccess.Bulk" />
                    
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 Wb.DataAccess.Bulk --version 1.2.2
                    
#r "nuget: Wb.DataAccess.Bulk, 1.2.2"
                    
#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 Wb.DataAccess.Bulk@1.2.2
                    
#: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=Wb.DataAccess.Bulk&version=1.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Wb.DataAccess.Bulk&version=1.2.2
                    
Install as a Cake Tool

About

一款批量处理数据的组件,可以对数据进行批量复制和批量修改,目前支持Sqlserver和Mysql(MysqlConnector)数据库。

A batch data processing component that supports batch copy and batch modification of data. Currently, it is compatible with SQL Server and MySQL (via MySQL Connector) databases.

Dependencies

SQL Server: Microsoft.Data.SqlClient / System.Data.SqlClient
Mysql: MySqlConnector

注意:组件需依赖于上述数据库连接库,请确保您的项目中已安装相应的NuGet包。

Note: This component may depend on the above database connection libraries. Please ensure that the corresponding NuGet packages are installed in your project.

How to Use

//bulk copy
using (IBulkData bulkData = new BulkData(new SqlConnection("xxx..")))
{
    var dt = this.GetCusTable(100000);
    //dt.Columns.Remove("Id");

    dt.TableName = "TB_Test";
    bulkData.BulkCopy(dt);
    dt.Dispose();
}


//bulk update
DataTable dt=new DataTable();
IBulkData bulkData = new BulkData(new MySqlConnetion("xxx.."));
bulkData.BulkUpdate(dt, new UpdateOptions()
{
    DestinationTableName = "TB_Test_bak",
    JoinColumnsNames = new List<string> { "Id" },
    UpdateColumnsNames = new List<string>
    {
        "SellerName",
        "Remark",
        "IsPaid",
        "Price"
    }
});
dt.Dispose();
bulkData.close();

Suggestions

Batch Insert

批量新增时最好不要提供主键列,让数据库自动生成有序的主键,以获得最好的写入性能。

When performing batch insertion, it is recommended not to include the primary key column. Instead, let the database auto-generate sequential primary keys to achieve optimal write performance.

Batch Update

批量修改时,请务必指定JoinColumnsNames。如果你能提供主键最好,如果不能,请设置一个唯一的列,以获得更快的批量更新效率。

When performing batch modification, be sure to specify JoinColumnsNames. It is preferable to provide the primary key (if available); if that's not possible, set a unique column instead—this ensures faster batch update efficiency.

feedback

若你在使用组件时遇到 Bug,或有使用建议,请通过以下邮箱联系

If you encounter a bug while using the component or have any suggestions for its usage, please contact via the following address: https://github.com/zwenbo001/wb.dataaccess.bulk/issues

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  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. 
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.2.2 215 9/23/2025