Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using entity Framework with .NET Core and DB2

Has anyone used .NET Core with DB2 and EF Core? We've tried to find compatible drivers, but none seem to exist. Has anyone found a way to use DB2 with .NET Core 3.0?

Thank you!

like image 284
ewomack Avatar asked Oct 28 '25 11:10

ewomack


2 Answers

IBM have now released a new version 3.1.0.300 of IBM.EntityFrameworkCore on nuget that works with EF Core 3.1.

A couple of things I needed to do for it to work:

  • Download new version of license file that targets DB2 version 11.5 from passport advantage
    • I don't know why this limitation exists, but our old 11.1 license simply did not work and the database was not upgraded at all.
  • License file must be copied to C:\Users\{YourUserNameHere}\.nuget\packages\ibm.data.db2.core\3.1.0.300\buildTransitive\clidriver\license
    • For older versions, replace buildTransitive with build

I'm assuming the user has access to the IBM Passport Advantage, I don't know about trial licenses.

It was quite confusing to find where to download the license file, but I figured it out and will mention the steps here for anyone else who needs to do it:

  • Determine which version of license is needed, in this case 11.5
  • Go to: https://www.ibm.com/support/pages/downloading-ibm-db2-version-115-linux-unix-and-windows
  • Find the correct part number for you from the list, for me it was CC6XNML.
  • Use the part number in the Passport Advantage software downloads page
    • Instructions: https://www.ibm.com/support/pages/node/99203
  • After that just download the lic file and place it in the library nuget installation directory mentioned above.

Note: It's still possible to use the older library with .NET Core 3.1, as long as EF itself is not updated to the 3.1 version. The problem is compatibily with EF 3.1, not .NET Core 3.1. As long as updating the EF nuget package to a newer version is avoided, things will work just fine.

like image 169
Shahin Dohan Avatar answered Oct 31 '25 10:10

Shahin Dohan


There is no core 3.0 or standard 2.1 support thanks to IBM's terrible .Net support. Supposedly an alpha driver will be available in March 2020 if you contact their support.

You can some of the conversation at this link.

like image 43
Delubear Avatar answered Oct 31 '25 10:10

Delubear



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!