title: IQueryable type to an Array
body: <p>I have a dynamic Linq query like this. I need to convert the result set into an array. But I am not able to convert the IQueryable type to an Array. Any suggestion?</p>
  
  <p><strong>my code:-</strong> </p>
  
  <pre><code>var query = Data.AsEnumerable()
                  .AsQueryable()
                  .Select("new(it[\"Country\"] as Country)", "it")
                  .Take(10);
  
  foreach (string str in query) // **getting error Unable to cast object of type 'DynamicClass1' to type 'System.String**
  {
  
  }
  </code></pre>
  
  <p>I fixed it using like this :- foreach(var str in query) . </p>
  
  <p>But I have another issue now. I have added where condition to the query. Now i am getting error "<strong>No property or field 'Country' exists in type 'DataRow'</strong>".
   following is my query</p>
  
  <pre><code> var query= Data.AsEnumerable().AsQueryable().Where("Country = @0", "London").Select("new (Country as Country)");
  </code></pre>