4

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!

0

3 Answers 3

5

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:

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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.

2 Comments

To follow up on this. They did release a 3.1 alpha driver, though you need to contact their support to be given access to it and it can only be downloaded through their Passport Advantage pages. Few bugs with it, but it does support basic value converters now, i.e. string trimming or smallInt fields to booleans.
IBM have released a provider compatible with EF Core 3.1 a few days ago in nuget.org.
0

There are packages for Db2 listed on the Database Providers EF Core help page. I haven't used them, personally, but if they're listed there, they should work fine.

2 Comments

Okay, those are from 2018 and seem to support up to Core 2.x. So it's probably fair to say that no .NET Core 3.0 drivers yet exist for DB2 - unless IBM is developing any?
The NuGets target .NET Standard 2.0, which means they're compatible with anything that implements .NET Standard 2.0, i.e. .NET Core 2.x and 3.x. It may have simply not needed any changes since 2018. The providers are very low-level. The main work (and most of the changes) happens in EntityFrameworkCore and EntityFrameworkCore.Relational.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.