Installation and Setup
Get started with ETLBox.DbExtensions in just a few minutes. This guide walks you through the installation via NuGet, setting up the required database provider, and running your first bulk operation.
Prerequisites
Before you get started, make sure your environment meets the following requirements:
- ETLBox.DbExtensions supports all current .NET versions supported by Microsoft, including .NET 8/9 or later and .NET Framework 4.8.0 or later
- Required: A supported ETLBox database provider package, e.g.
ETLBox.SqlServer
orETLBox.Postgres
- Recommended IDEs: Visual Studio 2022 , Visual Studio Code , or JetBrains Rider
- Basic knowledge of C# and working with NuGet packages
Install via NuGet
Add the following packages to your project:
ETLBox.DbExtensions
- The matching ETLBox connection package (e.g.
ETLBox.SqlServer
,ETLBox.Postgres
, etc.)
Add to Your Code
Add the necessary using
directives:
using ETLBox.DbExtensions;
using System.Data.SqlClient;
Run a Simple Test
Run the following SQL first to prepare your database:
CREATE TABLE dbo.Customer (
Id INT NOT NULL,
Name VARCHAR(100) NULL,
City VARCHAR(100) NULL
)
This snippet inserts 4,999 rows into the Customer
table using a standard IDbConnection
:
var connection = new SqlConnection("your-connection-string");
var customers = Enumerable.Range(1, 4_999)
.Select(i => new Customer { Id = i, Name = $"Customer {i}", City = $"City {i % 50}" });
connection.BulkInsert(customers);
public class Customer {
public int Id { get; set; }
public string Name { get; set; }
public string City { get; set; }
}
Troubleshooting Installation
Missing Provider?: Make sure the correct
ETLBox.*
database provider package is referenced (e.g.ETLBox.SqlServer
).Clear NuGet Cache::
dotnet nuget locals all --clear
Need Help?: Contact our support
Example Project:: See the simple demo on GitHub for a working example.
Prev
Bulk UpdateNext
Bulk Delete