I'm trying to connect iSeries DB2 AS400 database using C# .Net core 3.1. I'm using visual studio 2019 and have added IBM.Data.DB2.Core(3.1.0.400) nuget package to my console project. I have IBM data server driver package 11.5.4 and IBM iAccess Client solution and IBM data server client 11.5.4 installed. Upon installing IBM data server client I got the below error but system continued installing image.png
Below is the code where I am trying to connect to my database String connectionStr = “Server=serverIP:50000;Database=mydatabase;UID=myusername;PWD=mypassword”; DB2Connection con1 = new DB2Connection(connectionStr); con1.Open();
opening the connection throws an exception : $exception {“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: “xxx.xxx.xx.xx”. Communication function detecting the error: “connect”. Protocol specific error code(s): “10060”, “", "”. SQLSTATE=08001\r\n”} IBM.Data.DB2.Core.DB2Exception
and if change port number to 446 then I end up getting licensing error as below $exception {“ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968\r\n”} IBM.Data.DB2.Core.DB2Exception
Could someone please help me connecting to iSeries database using .net ?
Please let me know if I need to provide any more details to make the explanation better.
Thank you in advance!