0

A button on the aspx page checks whether the connection with the DB2 database server is established or not. My connection String is :

Server=xx.xx.xx.xx:446; Database=dd_unit; UID=db2admin; PWD=Secure*888; CurrentSchema=ptdd;

It is throwing me a SQL30081N error message:

  • $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: \"xx.xx.xx.xx\". Communication function detecting the error: \"connect\". Protocol specific error code(s): \"10060\", \"\", \"\". SQLSTATE=08001\r\n"} System.Exception {IBM.Data.DB2.DB2Exception}

I looked for the SQL30081N error and it is due to connection was terminated by the network by the tcp-ip layer. Now, does the problem is with the Connection String or is it something else? Kindly help me solve this issue.

Code: (Its throwing error after connection is opened)

protected void Button3_Click(object sender, EventArgs e)
    {
        DB2Connection con = new DB2Connection("Server=xx.xx.xx.xx:446; Database=MyDb; UID=MyUser; PWD=MyPass; CurrentSchema=ptdd;");
        try
        {
            con.Open();
            Label1.Visible = true;
            Label1.Text = "Conection done";
            con.Close();
        }
        catch (Exception)
        {
            Label1.Text = "connection failed";
        }

P.S. I'm using this to test my application

CuccoChaser
  • 1,059
  • 2
  • 15
  • 27
Vinayak Pahalwan
  • 2,915
  • 4
  • 26
  • 34
  • The connection string seems fine. Have you tried to remove the CurrentSchema part? Are you sure that nothing is blocking the comunication with that server (firewall) ? – Steve Jan 07 '13 at 09:24
  • @Steve yes i've also tried removing the CurrentSchema part. Still the same error. Lemme disable the firewall and check the result – Vinayak Pahalwan Jan 07 '13 at 09:28
  • @Steve after disabling firewall of that server, it does not resolve the issue – Vinayak Pahalwan Jan 07 '13 at 09:31
  • This is what I found regarding the error code `10060` Connection has reached the network timeout limit and is terminated by network Timeout by tcpip layer TCPIP has its own timeout value, if the open connection stayed too long, TCPIP will force the connection off. Usually this is network issue Check TCPIP's KEEPALIVE setting see note1 Are you sure the remote server is up ? The connection is timing out. Try giving a custom timeout and try again. – prthrokz Jan 07 '13 at 09:46
  • @prthrokz yes server is up, tried the custom timeout thing, it doest work, still throwing same error – Vinayak Pahalwan Jan 07 '13 at 10:21

1 Answers1

1

Port specified was incorrect. It must be 50000 as it is a tcp/ip connection

Vinayak Pahalwan
  • 2,915
  • 4
  • 26
  • 34