title: ADO.NET SQL Server performance: multiple result sets vs. multiple command executions
body: <p>With connection pooling or at least the assumption that the connection is not closed between calls, is there a network or server performance difference and how significant is it between one stored procedure execution with multiple result sets and multiple stored procedure executions.</p>
  
  <p>In pseudo code, something like</p>
  
  <pre><code>using(new connection)
  {
    using (datareader dr = connection.Execute(Command))
    {
      while (dr.NextResult())
      {
        while (dr.Read())
        {
          SomeContainer.Add(Something.Parse(dr));
        }
      }
    }
  }
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>using(new connection)
  {
    using (datareader dr = connection.Execute(Command))
    {
      while (dr.Read())
      {
        SomeContainer.Add(Something.Parse(dr));
      }
    }
  
    using (datareader dr = connection.Execute(Command))
    {
      while (dr.Read())
      {
        SomeContainer.Add(Something.Parse(dr));
      }
    }
  }
  </code></pre>