title: Getting data from Database object without using foreach
body: <p>I understand this method of getting DB data (using <code>foreach</code>):</p>
  
  <pre><code>  var db = Database.Open("Connection");
    var rows = db.Query("SELECT 1 columnName,2 columnName2 FROM Table");
  
    foreach(var row in rows){
        var data = row.columnName;
        //or
        var data = row[0];          
    }
  </code></pre>
  
  <p>This works, but how do I get the data without using a foreach?</p>
  
  <pre><code>  var data = rows[0][1];
  </code></pre>
  
  <p>^ This doesn't work.</p>
  
  <p>Basically, I am trying to figure out how to get the data without using a foreach. What would I have to do?</p>
  
  <hr>
  
  <h2>EDIT:</h2>
  
  <p><code>.Query()</code> returns:</p>
  
  <p>Type: System.Collections.Generic.IEnumerable</p>
  
  <p>The rows returned by the SQL query.</p>
  
  <p>As shown here: <a href="http://msdn.microsoft.com/en-us/library/webmatrix.data.database.query%28v=vs.111%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/webmatrix.data.database.query%28v=vs.111%29.aspx</a></p>