title: comparing dataset through vb.net
body: <p>dasaset (ds) contain value like this comapring two dataset and write the phone number from dataset to notepad which is not equal to dataset1.but am getting the result in notepad like the phone numbers which are equal to both dataset</p>
  
  <pre><code>dataset
  -------
  91  9942321400
  91  9865015695
  91  9677031515
  91  9994828285
  91  9688104229
  
  dataset1 values
  ----------------
  91  9942321400
  91  9865015695
  91  9677031515
  
  expected result in notepad
  --------------------------
  91  9994828285
  91  9688104229
  
  my code
  -------
  Dim i As Integer = 0
          Dim toggle As Boolean = False
          Do While (i &lt;= ds1.Tables(0).Rows.Count - 1)
              Dim phone As String = ds1.Tables(0).Rows(i).Item(1).ToString
              Dim j As Integer = 0
              Do While (j &lt;= Ds.Tables(0).Rows.Count - 1)
                  Dim dumphone As String = Ds.Tables(0).Rows(j).Item(4).ToString
                  If dumphone &lt;&gt; phone Then toggle = True 'This will set your flag to add the output.
                  j = (j + 1)
              Loop
              'After we're done checking if there's a match, we decided to add it to the output.
              If toggle = True Then
  
                  TextBox1.AppendText(a.ToString &amp; "|" &amp; b.ToString &amp; "|" &amp; c.ToString &amp; "|" &amp; d.ToString &amp; "|" &amp; phone.ToString &amp; "|" &amp; e1.ToString &amp; "|" &amp; f.ToString &amp; "|" &amp; g.ToString &amp; "|" &amp; h.ToString &amp; "|" &amp; i1.ToString &amp; "|" &amp; j1.ToString &amp; "|" &amp; k.ToString &amp; "|" &amp; l.ToString &amp; "|" &amp; m.ToString &amp; "|" &amp; n1.ToString &amp; "|" &amp; o.ToString &amp; "|" &amp; p.ToString &amp; "|" &amp; q.ToString &amp; "|" &amp; r.ToString &amp; "|" &amp; s.ToString &amp; "|" &amp; t.ToString &amp; "|" &amp; u.ToString &amp; "|" &amp; v.ToString &amp; "|" &amp; w.ToString &amp; "|" &amp; x.ToString)
                  sw.WriteLine(TextBox1.Text)
                  TextBox1.Text = ""
                  toggle = False 'Reset the flag for the next value
              End If
              i = (i + 1) 'Move to the next value to check against.
          Loop
  
  
  
  but am getting the output in note pad like this
  ------------------------------------------------
  91  9942321400
  91  9865015695
  91  9677031515
  </code></pre>