title: how to delete row when u loop on datatable
body: <pre><code>For Each Dr As DataRow In InvoiceDT.Rows
      Dim DrResult As Array = PaymentInvoiceDT.Select("Amount='" &amp; Dr("Amount").ToString() &amp; "'")
      If DrResult.Length &gt; 0 Then
          ''some code
      Else
          InvoiceDT.Rows.remove(Dr) 
      End If
  Next
  </code></pre>
  
  <p>It is giving error because when you changed something in datatable, its index get changed.</p>