<p>I have a self-referential Role table that represents a tree structure </p>

<pre><code>ID [INT] AUTO INCREMENT
Name [VARCHAR]
ParentID [INT]
</code></pre>

<p>I am using an ADO.NET DataTable and DataAdapter to load and save values to this table. This works if I only create children of existing rows. If I make a child row, then make a child of that child, then Update, the temporary ID value generated by the DataTable is going into the ParentID column. I have the following data relation set:</p>

<pre><code>dataset.Relations.Add(New DataRelation("RoleToRole",RoleTable.Columns("ID"), RoleTable.Columns("ParentID")))
</code></pre>

<p>And when I make new child rows in the DataTable I call the SetParentRow method</p>

<pre><code>newRow.SetParentRow(parentRow)
</code></pre>

<p>Is there something special I have to do to get the ID generation to propagate recursively when I call Update on the DataAdapter?</p>

Does it make any difference if you go
```
```
newRow.SetParentRow(parentRow, RoleTable.Relations("RoleToRole"))
```
```