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
10060Connection 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