IBM i Global

 View Only
Expand all | Collapse all

How can I connect to IBM iSeries/AS400 using .net Core (2.2 or 3.1) and IBM.EntityFrameworkCore (2.2 or 3.1)?

  • 1.  How can I connect to IBM iSeries/AS400 using .net Core (2.2 or 3.1) and IBM.EntityFrameworkCore (2.2 or 3.1)?

    Posted Wed October 14, 2020 04:27 PM

    Hello,

    I'm trying to connect to an IBM iSeries/AS400 DB2 database from a .net Core Console Application.

    I'm getting the error below and I want to solve it:

    ERROR [08001] [IBM] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "192.168.65.2". Communication function detecting the error: "recv". Protocol specific error code(s): "*", "*", "0". SQLSTATE=08001

    I'm sure that my connection information is correct because I succeeded using DBeaver (https://dbeaver.io/) with the DB2 iSeries/AS 400 connector using the same url and credentials that I'm trying in .net Core (from the same machine). DBeaver uses jdbc and a driver named: net.sf.jt400:jt400:RELEASE.

    In the .net core code I'm using the nuget package IBM.EntityFrameworkCore which in turn uses the nuget package IBM.Data.DB2.Core.

    These are the things I tried until now:

    - Test 2.2.0.100 and 3.1.0.300 versions of the IBM.EntityFrameworkCore package.

    - Try different values for the Interrupt parameter in the DB2ConnectionStringBuilder (0,1,2)

    - Try connecting by IP.

    - Tried with and without the LibraryList parameter.

    - Tried almost all combinations for the SetServerInfo Server Type / Version combinations

    DB2ConnectionStringBuilder connectionStringBuilder = new DB2ConnectionStringBuilder();

    connectionStringBuilder.UserID = "xxx";

    connectionStringBuilder.Password = "xxx";

    connectionStringBuilder.Server = "xxx:xxx";

    connectionStringBuilder.Database = "xxx";

    connectionStringBuilder.LibraryList = "xxx(same as database)"; //tried with or without

    connectionStringBuilder.Interrupt = 0; //tried 1,2,3

    optionsBuilder.UseDb2(connectionStringBuilder.ConnectionString, si =>

    {

    si.SetServerInfo(IBMDBServerType.AS400, IBMDBServerVersion.AS400_07_02); //tried almost all combinations

    });

    Any help will be appreciated.

    Thanks


    #SupportMigration
    #IBMi
    #Support


  • 2.  RE: How can I connect to IBM iSeries/AS400 using .net Core (2.2 or 3.1) and IBM.EntityFrameworkCore (2.2 or 3.1)?

    Posted Sat January 22, 2022 05:28 PM

    You may have already figured this out by now, but IBM i has it's own ODBC driver that can be downloaded here by IBM i customers: https://www.ibm.com/support/pages/ibm-i-access-client-solutions


    #SupportMigration
    #Support
    #IBMi