title: Oracle Data Access for .NET
body: <p>I have an MVC3 ASP.NET web application that uses Oracle Data Provider for .NET (ODP.NET) x86 to connect to an Oracle database. The below code within my app will execute a query in an Oracle database table, and then write the query results to an output file using StreamWriter. </p>
  
  <p>This below code reads about 12 thousand records per minute from an Oracle database table (even without using streamwriter to write to an output file). </p>
  
  <p>I'm wondering if any of you know of a way to have improved performance to read more records per minute - perhaps another driver that you know of? Thanks, I really appreciate it!</p>
  
  <pre><code>        _dbCommand.CommandText = query;
  
          using (var sw = new StreamWriter(output, append, Encoding.UTF8))
          {
              using (var reader = _dbCommand.ExecuteReader())
              {
                  if (reader != null)
                  {
                      var count = reader.FieldCount;
  
                      while (reader.Read())
                      {
                          //get records
                          for (var i = 0; i &lt; count; i++)
                          {
                              var txt = reader[i].ToString();
  
                              sw.Write(txt);
                          }
                          sw.WriteLine();
  
                      }
                  }
              }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>It looks like the bottleneck is with ODP.NET. It takes 53 seconds to read/iterate over a "select top 10k" type query from any table in my Oracle database.</p>
  
  <pre><code>_dbCommand.CommandText = query;
  using (var reader = _dbCommand.ExecuteReader())
              {
                  if (reader != null)
                  {
                      while (reader.Read())
                      {
  
                      }
                  }
              }
  </code></pre>