title: Retrieve the data from sql database and don`t encounter timeout exception
body: <p>I run the below code to extract the data from sql, <code>q</code> is a query I use.
  The set of data is huge and it takes > 2 min to bring it 
  Unfortunately I get an exception:</p>
  
  <blockquote>
    <p>Unhandled Exception: System.Data.SqlClient.SqlException: Timeout
    expired.  The timeout period elapsed prior to
         completion of the operation or the server is not responding.  This failure occurred while attempting to conne
        ct to the routing destination. ---> System.ComponentModel.Win32Exception: The wait operation timed out
           --- End of inner exception stack trace ---
           at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wr
        apCloseInAction)
           at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj, Boolean callerHa
        sConnectionLock, Boolean asyncClose)</p>
  </blockquote>
  
  <p>How can it be resolved and despite the ling time I will be able to retrieve all the data I need.</p>
  
  <pre><code>   List&lt;string&gt; dataList = new List&lt;string&gt;();
     using (SqlConnection connection = new SqlConnection(csb.ConnectionString))
     {
           connection.Open();
           using (SqlCommand command = new SqlCommand(q, connection))
           {
                 using (SqlDataReader reader = command.ExecuteReader())
                 {
                        if (reader.HasRows)
                        {
                             while (reader.Read())
                             {
                                 dataList .Add(reader.GetString(0));
                             }
                        }
                 }
           }
      }
  </code></pre>