title: C# treeview getting duplicate nodes
body: <p>By the beginning of this week Iwas having a problem with TreeView not displaying children. Everything got worked out through recursiveness. However, a new and unexpected problem arose: the methods i'm using are getting duplicate nodes on some specific DataTables.</p>
  
  <p>Having this DataTable of two columns:</p>
  
  <pre><code>ParentOT    ChildOT
  20120601    20120602
  20120601    20120603
  20120601    20120604
  20120601    20120611
  20120601    20120612
  20120602    20120605
  20120602    20120606
  20120602    20120607
  20120602    20120608
  20120602    20120610
  20120603    20120607
  20120603    20120608
  20120603    20120609
  </code></pre>
  
  <p>If I try to display its Treeview I get the right treeview, but five times consecutively (the times the parent appears as parent in parentOT records).</p>
  
  <p>The Methods are these:</p>
  
  <pre><code> private TreeView cargarOtPadres(TreeView trv, int otPadre, DataTable datos)
      {
          if (datos.Rows.Count &gt; 0)
          { 
              foreach (DataRow dr in datos.Select("OTPadre="+ otPadre))
              {
                  TreeNode nodoPadre = new TreeNode();
                  nodoPadre.Text = dr["OTPadre"].ToString();
                  trv.Nodes.Add(nodoPadre);
                  cargarSubOts(ref nodoPadre, int.Parse(dr["OTPadre"].ToString()), datos);
              }
          }
          return trv;
      }
  
      private void cargarSubOts(ref TreeNode nodoPadre, int otPadre, DataTable datos)
      {
          DataRow[] otHijas = datos.Select("OTPadre=" + otPadre);
          foreach (DataRow drow in otHijas)
          {
              TreeNode hija = new TreeNode();
              hija.Text = drow["OTHija"].ToString();
              nodoPadre.Nodes.Add(hija);
              cargarSubOts(ref hija, int.Parse(drow["OTHija"].ToString()), datos);
          }
      }
  </code></pre>
  
  <p>With Tables with just 1 great parent appearing 1 time only, it works great. How can i prevent the TreeView from duplicating??</p>