title: System.Data.OleDB 'Data type mismatch in criteria expression.'
body: <p>I've been trying to get different columns from different tables (Access database) into one DataTable. The query / command is correct, but the adapter causes an error</p>
  <blockquote>
  <p>System.Data.OleDb.OleDbException:'Data type mismatch in criteria expression.'</p>
  </blockquote>
  <p>The Command is</p>
  <pre><code>SELECT tab_agend.ID, tab_teams.Descricao, tab_agend.idtask 
  FROM tab_teams 
  INNER JOIN tab_agend ON tab_teams.ID = tab_agend.idequipa;
  </code></pre>
  <p>It does work on Access but Visual Studio throws an error on the line:</p>
  <pre><code>adapter.Fill(dset, &quot;table&quot;);
  </code></pre>
  <p>Full code:</p>
  <pre><code>string query;
  
  if (Tabela == &quot;tab_agend&quot;) 
  {  
      query = &quot;SELECT tab_agend.ID, tab_teams.Descricao, tab_agend.idtask &quot; + 
              &quot; FROM tab_teams &quot; + 
              &quot; INNER JOIN tab_agend ON tab_teams.ID = tab_agend.idequipa;&quot;;
  } 
  else 
  {  
       query = &quot;SELECT * FROM &quot; + Tabela;
  }
  
  dset.Reset();
  
  adapter = new OleDbDataAdapter(query, connection);
  adapter.Fill(dset, &quot;table&quot;);
  </code></pre>