I am trying to connect to IBM DB2 using VS2012 and framework 4.0. I installed the 64 bit IBM Data Server Driver Package (DS Driver) (V10.5 fix pack 2) and 32 bit (only 1 available) IBM Database Add-Ins for Visual Studio (V10.1 FP 2)
If I connect using ODBC drivers, the connection is successful. But if I use IBM.Data.DB2 to connect, I get the following error:
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: "10.60.20.34". Communication function detecting the error: "connect". Protocol specific error code(s): "10061", "", "". SQLSTATE=08001
Here is the sample code:
string connStr = "Database=TestDB;User ID=demouser;Password=demouser5;Server=DemoServer;Connection Timeout=0";
DB2Connection cn = new DB2Connection();
cn.ConnectionString = connStr;
cn.Open();
Console.ReadKey();
cn.Close();
This link says that it might be a firewall problem on the server, but then how is ODBC able to connect and IBM drivers throws an exception.
Any insights appreciated.