Having trouble connecting to iSeries from .NET Core

408 Views Asked by At

This is a follow-up from the following question: Having trouble connecting to iSeries from .NET Core

The initial problem was resolved by setting a port number. I'm now running into the problem of the connection seemingly opening, however, hanging on the actual .Open() step - IE, never continuing on to the next line of code. For reference, here's my code block:

public static DB2Connection GetDatabaseConnection(string connectionString)
{
    DB2Connection DB2Connection = new DB2Connection(connectionString);

    DB2Connection.SystemNaming = true;

    try
    {
    DB2Connection.Open();
    return DB2Connection;
    }
    catch (Exception ex)
    {
    throw ex;
    }
}

And my connection string is in this format: Server=###.###.###.###:#####;Database=DATABASE;UID=USER;PWD=PASSWORD;LibraryList=LIBRARY,LIST

Looking at the logs on the i Navigator, I see that there is a job name Qzhqssrv when is opened, with the user Quser, status Running, and type Prestart batch - Server. Looking into the logs for that entry, I see Job #####/QUSER/QZHQSSRV started on DATE at TIME in subsystem QUSRWRK in QSYS. Job entered system on DATE at TIME. However, it doesn't seem to continue beyond that.

Looking at the logs for a similar operation, when I'm connecting via Access Client Solutions, I get considerably more information and more steps in the logs. This leads me to believe that the system is waiting for me to send further information, however, my application is still stuck on .Open() - so perhaps there is something else I was supposed to send as part of the .Open() instruction. If so, I'm not sure what it would be.

Any insights would be greatly appreciated. Thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

Just to close this topic out - the problem was indeed the lack of a license. Connecting on port 446 was the correct approach, and once we got a license, we were able to get the connection working. Thanks @nfgl!