title: Count specific datatable columns
body: <p>How to count datatable columns (created dynamically) that has the same first two characters in the header? Here's my code so far but is not working.</p>
  
  <pre><code>    For col As Integer = 3 To dt.Columns.Count - 1
          Dim cntLE, cntUE As Integer
          If dt.Columns(col).ColumnName.Substring(0, 2) = "LE" Then
              cntLE = dt.Columns.Count
          ElseIf dt.Columns(col).ColumnName.Substring(0, 2) = "UE" Then
              cntUE = dt.Columns.Count
          End If
      Next
  </code></pre>