title: Foreach error when checking data from database
body: <p>I am working on a small piece of code to loop through my database data. I get to rows from the database and want loop through one with an foreach. Then within the foreach, I am currently trying to make a console message so I can see if it works. </p>
  
  <p>The function <code>Common.Log</code> is a function made by myself and a co-worker.</p>
  
  <p>This is the code:</p>
  
  <pre><code>SqlParameter bonIdParam = new SqlParameter("bonId", bonId);
  DataTable controleTable = RidderQuery(controleQuery, bonIdParam);
  DataRow controleRow = controleTable.Rows[0];
  
  int code= controleRow .Field&lt;int&gt;("CODE");
  int productionDone = queryRow.Field&lt;int&gt;("PRODUCTIONDONE"); // 1 = true, 0 = false
  
  foreach(int checkedCode in controleRow .Field&lt;int&gt;("CODE"))
  {
      Common.Log(checkedCode.ToString);
  }
  </code></pre>
  
  <p>The problem that I have is, that the foreach loop does not work. yes I know that very unclear, but I don't know how to explain it better.
  So these are the errors im getting:</p>
  
  <blockquote>
    <ul>
    <li><p>Error 3: Argument 1: cannot convert from 'method group' to 'string' </p></li>
    <li><p>Error 1: foreach statement cannot operate on variables of type 'int' because 'int' does not contain a public definition for 'GetEnumerator' </p></li>
    <li><p>Error 2: The best overloaded method match for 'LocatieVerwerkingWifi.Common.Log(string)' has some invalid arguments </p></li>
    </ul>
  </blockquote>
  
  <p>What can I do to fix these errors? I think the problem is in this line:</p>
  
  <pre><code>foreach(int checkedCode in queryRow.Field&lt;int&gt;("CODE"))
  </code></pre>
  
  <p>But I don't understand what is going wrong. Can someone explain/help me with this issue?</p>