dotConnect for DB2 is a enhanced database connectivity solution built over ADO.NET architecture and a development framework with a number of innovative technologies.
Install
| Product | Versions |
|---|---|
| .NET |
README
dotConnect for DB2
dotConnect for DB2 is a high-performance ORM enabled data provider for DB2 that builds on ADO.NET technology.
The provider works with .NET Frameworks 2.0+, .NET Core 2.0+, .NET 5+. The product is compatible with ADO.NET Entity Framework (EF) Core.
It also includes visual ORM designer for Entity Framework, Entity Framework Core, and LinqConnect ORM models.
More information at dotConnect for DB2.
Installation
For projects, using Entity Framework Core 10 with DB2, install this package. Execute the following command in the Package Manager Console:
Install-Package Devart.Data.DB2.EFCore
For projects that require integration with Entity Framework 6.4 (EF6), use the Devart.Data.DB2.EF6 package.
There also are Visual Studio extensions for earlier Visual Studio versions. If you use some other tool than Visual Studio, you can get NuGet packages with the nuget.exe console tool.
License
dotConnect for DB2 is available in several editions. See pricing options for ordering.
The NuGet package initiates the retrieval of an activation key from the Devart website. This key is required to activate the product for a free trial.
Compatibility
The following table show which version of this package to use with which version of frameworks.
| Frameworks | Version support |
|---|---|
| Entity Framework Core | 10 |
| .NET | 10 |
More information here
Usage
This snippet directly configures a DB2 database connection for an Entity Framework Core DbContext using a connection string.
public class MyDbContext : DbContext {
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
optionsBuilder.UseDB2(@"UserId=db2admin;Password=mypassword;Server=db2:50000;Database=SAMPLE");
}
}
Configuration Using DB2Connection Instance
using Devart.Data.DB2;
...
public class MyDbContext : DbContext {
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
var connection = new DB2Connection();
connection.Server = "db2:50000"
connection.UserId = "db2admin"
connection.Database = "SAMPLE"
connection.Password = "mypassword"
optionsBuilder.UseDB2(connection);
}
}
ASP.NET Core and Blazor
Configuration File (appsettings.json):
{
"ConnectionStrings": {
"DefaultConnection": "UserId=db2admin;Password=mypassword;Server=db2:50000;Database=SAMPLE"
}
}
DbContext Configuration:
public class MyDbContext : DbContext {
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
IConfiguration configuration = builder.Build();
optionsBuilder.UseDB2(configuration.GetConnectionString("DefaultConnection"));
}
}
For more information about secure connections read at our documentation.
Key Features
- Direct Mode: Allows your application to work with DB2 directly, without additional libraries.
- ASP.NET Core: Supports ASP.NET Core Identity.
- Performance: Uses many DB2-specific performance features & optimizations to ensure the highest performance.
- Monitoring: Allows per-component tracing of database events with a free dbMonitor application.
- Security: Supports various encryption SSL and SSH connections, etc.
- Support and updates: Enjoy dedicated support team for prompt issue resolution and regular updates to keep your software running smoothly and securely.
Related Packages
Support Area
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.