Powered by Zoomin Software. For more details please contactZoomin

DataDirect Connect for ADO.NET Data Provider Help

Configuring the DB2 Entity Framework Data Provider

Configuring the DB2 Entity Framework Data Provider

  • Last Updated: April 16, 2026
  • 1 minute read
    • ADO.NET
    • Documentation

The Entity Framework data provider uses the functionality defined by the DB2 data provider. See The DB2 Data Provider for details. Connect for ADO.NET DB2 Data Provider supports Entity Framework.

For the latest support and certification information, visit the DataDirect Product Compatibility Guide.

You must register an Entity Framework by configuring the provider. You can do this in two ways: using config file registration or code-based registration.

Note: The performance and behavior of the EdmGen and Visual Studio tools can be impacted by the data provider configuration options, when you use the DB2 Entity Framework data provider to create and manipulate ADO.NET Entity Data Models.

Provider Registration: Config File Registration

  1. To work with Entity Framework, you must first install EntityFramework NuGet package.
  2. Once the package has been installed, the app.config file gets created.
  3. Remove the defaultConnectionFactory registration section from the app.config file and replace it with the following lines of code:
<providers>     
<provider invariantName="DDTek.DB2" type="DDTek.DB2.Entity.DB2ProviderServices, DDTek.DB2.Entity, Version=4.3.0.0, Culture=neutral, PublicKeyToken=c84cd5c63851e072" />
</providers>

This adds the Entity Framework provider registration in the Entity Framework section of the app.config file.

Provider Registration: Code-Based Registration

You can configure the Entity Framework application through code-based registration. To do this, you must add a new class, DbConfiguration class to your test application:

public class MyConfiguration : DbConfiguration{
public MyConfiguration()
{
SetProviderServices("DDTek.DB2.Entity", new DB2ProviderServices());
}
}

Note: While testing your applications locally, you can use code-based registration during development time. However, when you deploy your project, you must register the Entity Framework provider using the config file registration method.

TitleResults for “How to create a CRG?”Also Available inAlert