Data Management Global

 View Only

Getting started with IBM Db2 .NET NuGet packages

By Hosathota Vishwanatha posted Wed April 19, 2023 06:15 AM

  

IBM .NET Provider for .NET 8 / .NET 9 are for developing applications using MS .NET  .NET 8/.NET 9 and connecting to IBM data servers(namely LUW, IBM i, zOS and Informix). These applications can run on multiple platforms and packages are platform specific. IBM Data Server Provider packages are available for download from NuGet repository.

Instructions for downloading and using the package

  Path/LD_LIBRARY_PATH needs to be updated to include the package driver path.

     Apart from this, the download links and other commonly asked questions are listed in the Frequently Asked Questions. In cases where diagnostics needs to be collected for any issue, please follow the instructions on tracing.

Points to remember for using this package:

  • The license needed for connecting to DB2 databases remains the same as that of the DB2Connect for IBM databases.
  • There are separate packages for Windows, Linux, Mac, ppc64le and Linux on IBM Z.
  • Most of the features of MS ADO.NET like Connection, Command, DataReader and server specific data types are supported. 

Supported platforms and OS:

  • Windows 64-bit
  • Linux AMD64
  • macOS
  • Linux on IBM Z
  • ppc64le

Supported IBM database servers

  • zOS
  • LUW including IBM dashDB
  • IBM i

Specific samples of using Db2 .NET packages



 Last updated on 23rd April 2025

3 comments
126 views

Permalink

Comments

Tue February 06, 2024 07:59 AM

Every statement we make produces the same error.

System.ArgumentNullException: Value cannot be null. (Parameter 'format')

Version 8.0.0.100 of IBM.EntityFrameworkCore does not work.

Fri May 12, 2023 05:20 PM

I migrated from 3.1 to 6.0 and I have an issue every time I do Context.SaveChanges() after modifications made inside a Transaction using BOSContext.Database.BeginTransaction() .. It was working fine in 3.1.
This is the error:
IBM.Data.Db2.DB2Exception: 'ERROR [42601] [IBM][DB2] SQL0104N  An unexpected token "<END-OF-STATEMENT>" was found following "".  Expected tokens may include:  "ON UNIQUE".' 
Code example:

            using (var transaction = SomeContext.Database.BeginTransaction()){                
                try{
                    var obj = SomeContext.SomeTable.Where(x => x.SomeFieldId == 1).FirstOrDefault()
                    obj.SomeFieldToUpdate= "New Value"; 
                    if (SomeContext.SaveChanges() == 1) //=> Fails here with the exception mentioned above
                        transaction.Commit()                        
                } catch (Exception){
                    transaction.Rollback();
                    throw;
                }                
            }



Thu May 04, 2023 12:10 PM

It appears that the "Skip" and "Take" commands are not working properly with this driver. Specifically, when I attempt to use these commands in my LINQ queries, I receive an error indicating that the expected SQL syntax is not being generated.
 
As an example, when I use the following code:
 
Entity.AsNoTracking().OrderBy(e => e.ID).Skip(skip).Take(take);

I receive the following error message:
 
ERROR [42601] [IBM][DB2/NT64] SQL0104N  An unexpected token "?" was found following "_CLIENTE FETCH FIRST".  Expected tokens may include:  "<space>".
 
I would appreciate any insights you may have on how to resolve this issue. Are there any known workarounds or planned updates to address this problem?

Im using:
"IBM.EntityFrameworkCore" Version="7.0.0.200"
"Net.IBM.Data.Db2" Version="7.0.0.200"

Thank you for your attention to this matter.