Having trouble connecting to iSeries from .NET Core

0

Cross-posting with this on the IBM forums: https://www.ibm.com/mysupport/s/forumsquestion?id=0D50z00006egDnsCAE. Follow-up question located here: Having trouble connecting to iSeries from .NET Core

Hi all,

I'm very new to this whole thing, so let me know if there's any info which would help, that I'm not providing.

At the moment I'm just trying to get the very basics working - getting the connection to open. I have a stripped-down .NET Core project, which is simply exposing a button I can press that opens a connection for DB2. My code is as follows:

using IBM.Data.DB2.Core; 
... 
DB2Connection DB2Connection = new DB2Connection(connectionString); 
DB2Connection.SystemNaming = true; 
DB2Connection.Open();

My connection string is as follows:

"Server=###.###.###.###;Database=AAAA;UID=BBBB;PWD=CCCC;LibraryList=DDDD,EEEE;"

I'm getting the following exception:

IBM.Data.DB2.Core.DB2Exception (0x80004005): 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: "###.###.###.###". Communication function detecting the error: "connect". Protocol specific error code(s): "10061", "*", "*". SQLSTATE=08001

I really don't know how to proceed from here. For context - I'm using "IBM Navigator for i" to query the info directly, and that works just fine for the IP, User ID, and Password I used above.

I've done some reading up, and attempted a few different solutions, but none really helped. I did see that in "Integrating DB2 Universal Universal Database for iSeries with for iSeries with Microsoft ADO .NET", it suggested looking in the Work Management section of the navigator, and check under Server Jobs to see whether there was any added info - however, it does not appear there is anything there to see.

I do understand that I may require a license for this connection to work properly, and accept that if that ends up being the problem, I'll need to get the license - but I don't think I've reached that stage yet. For now I just want to make sure the connection itself works properly.

Any help or insights are greatly appreciated. Thank you.

.net-core
db2
iseries-navigator
asked on Stack Overflow Sep 9, 2020 by Kiran Ramaswamy • edited Sep 21, 2020 by Kiran Ramaswamy

1 Answer

1

The symptom SQL30081N with 10061 was resolved by including the PORT=xxx; in the connection string, where xxx is the correct TCP/IP port number on which the Db2-for-i-series is listening for connections.

answered on Stack Overflow Sep 19, 2020 by mao

User contributions licensed under CC BY-SA 3.0