Wednesday, December 15, 2010

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.-solution

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
solution
      SqlConnection myConnection = new SqlConnection(ConnectionStringrk);
        string strSQL;
        strSQL = "runube_acctbal  'R55570001','IVG0001','" + sbledgr.ToString() + "','" + txtFdate.Text + "','" + txttdate.Text + " '";
    
        SqlCommand cmd = new SqlCommand(strSQL, myConnection);
        cmd.CommandTimeout = 300; //5 min.
        cmd.CommandType = CommandType.Text;
        myConnection.Open();
        cmd.ExecuteNonQuery();
        myConnection.Close();

No comments: