title: How to select data in rows using LINQ?
body: <p>How can I use <code>LINQ</code> to <code>select</code> all the <code>Company Name</code> and <code>Company ID</code> from all the rows? I need something like this pseudo-code:</p>
  
  <pre><code> var typedQry = from b in allData.AsEnumerable()
                  where b.GetHeader("xxx") == "08/10/09 to 08/26/09"
                  select CompanyName, CompanyID, ...
  </code></pre>
  
  <p>The code below selects only one Company Name. Instead, I want Company Name from all the rows:</p>
  
  <pre><code>var typedQry3  = from b in allData.AsEnumerable()
  select new { compname0 = b._rows[0][5]}; 
  </code></pre>
  
  <p>The data in <code>_rows</code> are <code>Company Name</code> <code>(e.g., allData[0]._rows[0][5], allData[0]._rows[1][5],....)</code>, <code>Company ID</code>, and so forth. </p>
  
  <p>However, <code>Company Name</code>, <code>Company ID</code>, and etc. are not defined in the DataProperty class. Their values are inserted into _rows from data files.</p>
  
  <p>Any help is appreciated. Below is some code to help you understand my question.</p>
  
  <pre><code>List&lt;DataProperty&gt; allData = new List&lt;DataProperty&gt;();
  </code></pre>
  
  <p>The DataProperty class consists of </p>
  
  <pre><code>private readonly Dictionary&lt;string, string&gt; _headers = new Dictionary&lt;string, string&gt;(); 
  private readonly List&lt;string[]&gt; _rows = new List&lt;string[]&gt;();
  </code></pre>
  
  <p>and these methods (among others):</p>
  
  <pre><code>public string[] GetDataRow(int rowNumber){return _rows[rowNumber];}
  public void AddDataRow(string[] row){_rows.Add(row);}
  </code></pre>