title: How can I delete all child rows and the parents in a DataSet?
body: <p>So, I have a <code>DataRelation</code> as is shown below: </p>
  
  <pre><code>Oraciones1 = new DataRelation("Antecedentes",
          dsPubs.Tables["Consecuente"].Columns["Id"],
          dsPubs.Tables["Antecedentes"].Columns["Id"]);
          dsPubs.Relations.Add(Oraciones1);
  </code></pre>
  
  <p>where  <code>dsPubs</code>  is  <code>dsPubs = new DataSet()</code> and that DataSet has two tables which Both have a data relation. Then; I am iterating over the parents  to get the childs, just to get some task done as is shown next: </p>
  
  <pre><code>foreach (DataRow rowAuthor in dsPubs.Tables["Consecuente"].Rows) {             
      foreach (DataRow rowTitle in rowAuthor.GetChildRows(Oraciones1)) {
  
      }
  }
  </code></pre>
  
  <p>and what I want to do is to remove all  the child and the parent from an a  specified value  which is passed through a function(i.e).</p>
  
  <pre><code>public void function(string value ){
    foreach (DataRow rowAuthor in dsPubs.Tables["Consecuente"].Rows){             
               foreach (DataRow rowTitle in rowAuthor.GetChildRows(Oraciones1){
  
                          if(value==rowTitle["id_d"].ToString()){
                            //remove all the child and the parent from the specified variable "value"   
                         }
  
                      }
                  }
  
  }
  </code></pre>
  
  <p>I tried to get it done by using <code>rowTitle.Delete() and rowAuthor.Delete() method</code> but it seemed to not be working, because  I think it removes the whole table, and a the time The foreach wanted to continue to grab another value from the table <code>"Consecuente"</code> it crashed. 
  Thank you a lot!!</p>