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 5 / .NET 6 / .NET 7 / .NET 8 is for developing applications using MS .NET 5 / .NET 6 / .NET 7 / .NET 8 connecting to IBM data servers(namely LUW, IBM i, zOS and Informix). These applications can run on Windows, Linux and MacOs. IBM Data Server Provider  packages are available for download from NuGet repository.

What is new in EF 8.0.0.200 and .NET 7 version 8.0.0.200

  • Support for .NET 8 and inclusion of other defect fixes previous previous streams.
  • Crash issue noticed in .NET 8.0.0.100 packages is fixed. We mark 8.0.0.100 package as unusable and suggest not to use it.

What is new in EF 7.0.0.400 and .NET 7 version 7.0.0.400

  • Fix for access violation exception
  • Updated dependency drivers.
  • Crash issue noticed in 7.0.0.300. We suggest not to use 7.0.0.300 anymore.

What is new in EF 7.0.0.200 and .NET 7 version 7.0.0.200

  • Support for Boolean data type and support for specifying TLS version is included in this.

What is new in .NET 6 version 6.0.0.400

  • TLS support- Connection string and ConnectionStringBuilder
  • Boolean support for IBMi v7r5 n later
  • Fix for AccessViolationException while invoking a StoredProcedure from Db2 .NET driver
  • Fix for CLI0111E Numeric value out of range. SQLSTATE=22003 ERROR [HY010] [IBM] CLI0125E Function sequence error

What is new in EF 6.0.0.300 and .NET 6 version 6.0.0.300

  • In EntityFramework , fix for DateTime casting while using ThenInclude() method in LINQ Query is included.
  • In .NET 6, fix for the memory corruption issue which leads to segmentation faults on Linux environments is included.

What is new in version 5.0.0.300

  • SAVEPOINT support in Transactions
  • Asynchronous support in Entity Framework.

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 and Linux and Mac.
  • Most of the features of MS ADO.NET like Connection, Command, DataReader and server specific data types are supported.
  • The ADO.NET features which are excluded in MS .NET .NET 6 and above are not available in IBM .NET 6 and above.

 

Supported platforms and OS:

  • Windows 64-bit
  • Linux AMD64
  • macOS

Supported IBM database servers

  • zOS
  • LUW including IBM dashDB
  • IBM I
  • Informix

Examples and samples

 

Other features which are not yet there in this release

    Some of the features are not yet supported in this release. The Limitations page lists it.



 [This is an updated re-post of existing blog due to edit restrictions]

Last updated On 6th February 2024

3 comments
101 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.