title: VB.NET - Issue with looping through rows in a datagrid
body: <pre><code> For Each row As DataRow In dgrFarms.Rows
          Dim sendtroopid As Integer
          sendtroopid = row("idColumn")
          'Do Something
  Next
  </code></pre>
  
  <p>I've been trying to get a loop through a row in just one column in VB.NET for a while now, and i've done my homework on it too. When i use that code above I get:</p>
  
  <p>Unable to cast object of type 'System.Windows.Forms.DataGridViewRow' to type 'System.Data.DataRow'.</p>
  
  <p>I saw another guide which told me to do:</p>
  
  <pre><code>For Each row As DataGridView In dgrFarms.Rows
          sendtroopid = row("idColumn")
          'Do Something
  Next
  </code></pre>
  
  <p>But that gives me the error: </p>
  
  <p>Overload resolution failed because no accessible 'Item' accepts this number of arguments.   </p>
  
  <p>(That's a blue underline on 'Row("idColumn") )</p>