title: How to increase the execution time of ASP.Net
body: <p>I have written a query which is taking more then 30 sec.</p>
  
  <p>My Code:</p>
  
  <pre><code>MySqlConnection myConnection = new    MySqlConnection(ConfigurationSettings.AppSettings["CollectiveIntelligence"]);
  
      string query = @"SELECT TBL.NAME1,
                             TBL.NAME2 
                        FROM (SELECT MLD1.LOGIN_NAME AS NAME1,
                                     MLD2.LOGIN_NAME AS NAME2 
                                FROM FEDERATED_M_LOGIN_DETAILS MLD1 
                                JOIN FEDERATED_M_LOGIN_DETAILS MLD2 
                               WHERE MLD1.LOGIN_NAME &lt; MLD2.LOGIN_NAME
                            ORDER BY NAME1,NAME2) TBL
                       WHERE NOT EXISTS (SELECT USER_NAME1,
                                                USER_NAME2 
                                           FROM CONNECTION C
                                          WHERE (C.USER_NAME1 = TBL.NAME1 AND C.USER_NAME2 = TBL.NAME2));";
  
      MySqlCommand myCommand = new MySqlCommand(query, myConnection);
  
      //Open Connection
      myConnection.Open();
      myCommand.CommandTimeout = 0;
      MySqlDataReader reader = myCommand.ExecuteReader();
  
      DataTable dt = new DataTable();
      dt.Load(reader);
  
      GridView1.DataSource = dt;
      GridView1.DataBind();
  
      myConnection.Close();
      reader.Close();
  </code></pre>
  
  <p>Error Occurring </p>
  
  <pre><code>    MySqlDataReader reader = myCommand.ExecuteReader();
  </code></pre>
  
  <p>Error Message: <strong>Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding</strong></p>
  
  <p>how to increase the execution timeout of asp.net so that it will execute the query/</p>
  
  <p>[EDIT]</p>
  
  <p>when i click the explain its showing like this</p>
  
  <pre><code>id select_type  table   type   possible_keys   key              key_len   ref   rows   Extra
  1, SIMPLE,      MLD1,   ALL,   ,               ,                 ,         ,    295,   Using temporary; Using filesort
  1, SIMPLE,      MLD2,   ALL,   ,               ,                 ,         ,    295,   Using where; Using join buffer
  1, SIMPLE,      C,      index, ,               INDEX_CONNECTION, 94,       ,    30754,   Using where; Using index; Not exists
  </code></pre>
  
  <p>[/EDIT]</p>
  
  <p>Please Help </p>
  
  <p>Thanks in Advance</p>