title: Linq Select * from Table ExecuteQuery
body: <p>First let me start by saying that I don't have a complete understanding of Linq.  I am trying to dynamically query a database, The first query uses LINQ-SQL which works fine, but the second dynamic call is what fails in run time</p>
  
  <pre><code>public void getTables()
      {
          foreach (var c in dc.GetTable&lt;TableListing&gt;())
          {
              List&lt;TableData&gt; res = tableBrowse(c.TableName);
          }                  
      }
  
   public List&lt;TableData&gt; tableBrowse(string tablename)
      {
          string sql = "Select * from " + tablename;
          var results = dc.ExecuteQuery&lt;TableData&gt;(sql);
          return results.ToList();
      }
  
  public class TableData
      {
          public int Time { get; set; }
          public string Value { get; set; }
      }
  </code></pre>
  
  <p>I query the "master table" and this retrieves a list of tables to query.  They all have the same structure, as defined in the class TableData.  I get a runtime error about Specified cast is not valid.  I'm not really looking for code as much as I am looking for what I am doing wrong and how to fix it.  Thanks.</p>