title: Set-based execution; SQL and .NET
body: <p>In SQL, one should always strive for set-based operations versus iteration-based (i.e. looping). In .NET, we frequently loop collections and objects. Are there any commands in .NET that allow set-based processing or is everything iteration-based? (I'm reminded of how <code>DataAdapter.Fill</code> calls <code>DataReader</code> which iterates through each record in the result set). I'm not terribly familiar with <code>LINQ</code>, but my guess would be that its implementation merely masks the iterations happening behind the scenes.</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>To clarify: <em>I'm not claiming to be any sort of genius here and I'm not second guessing any of the brilliant people who make my life programming better.</em> I am simply asking if there are commands that perform set-based operations, like SQL does when you <code>UPDATE</code>, versus <code>foreach(var item in obj) { ... }</code> which is clearly iterating through the object. SQL developers are chastised at every turn if ever they use a loop, yet in .NET, we use them all the time. Being a develper who works heavily in both SQL and .NET, I'm asking if there are any alternatives in .NET that avoid looping altogether.</p>