title: vb.net check all row contain value
body: <p>I am a newbie in VB.Net.
  Recently I want to check if the row contains a value or not, if contain, return true, if not, contain false.</p>
  <p>Imagine this is my table call employee</p>
  <pre><code>DEPARTMENT  NAME
  -------------------
     ABC      AAA
     CDE      BBB
     EFG      CCC
  </code></pre>
  <p>From what I know in PHP, we could use this to get all value from the row.</p>
  <pre><code>    while( $row = mysqli_fetch_array($query) ){
          if($row['DEPARTMENT'] == &quot;CDE&quot;){
              echo &quot;True&quot;;
          }
          else {
              echo &quot;False&quot;;
          }
      }
  </code></pre>
  <p>And this is my code in VB.NET</p>
  <pre><code> Dim da As Odbc.OdbcDataAdapter
   Dim ds As DataSet
   Dim dt As DataTable
   da = New Odbc.OdbcDataAdapter(&quot;SELECT * FROM employee&quot;, Connection)
      ds = New DataSet
      da.Fill(ds, &quot;employee&quot;)
      dt = ds.Tables(&quot;employee&quot;)
      For Each row As DataRow In dt.Rows
          If (row(&quot;DEPARTMENT&quot;) = &quot;ABC&quot;) Then
              MsgBox(&quot;True&quot;)
          Else
              MsgBox(&quot;False&quot;)
          End If
      Next
  </code></pre>
  <p>The Main problem is if I tried to get the first record, the statement if work. But when I tried to get record number 2, example <code>row(&quot;DEPARTMENT&quot;) = &quot;CDE&quot;</code> the result statement is always false, this should not correct because the row is contain &quot;CDE&quot;. I tried to solve and googling it all day, but I can't find the way out</p>