How to add a Row to GetChildRows

S

Softwaremaker

Hi Fellows,

Just a simple question,

I have a table with one row. This row itself has got multiple Child Rows.
Once I retrieve this array of rows using GetChildRows, how do I add a row
into it ?

If I add to the childtable in the dataset
ds.tables(1).Rows.add(dataRow)
and I do a Row Count, it reflects correctly but not in the xml as shown
below
However this row is not added to the ChildRows of the ParentRow of the main
table as evident when I count the rows in the GetChildRows.

The ds.xml reads like this :
<clsItem>
<Usernames>
<Username>Willie</Username>
<Username>William</Username>
</Usernames>
<Username>Bill</Username>
</clsItem>

when it should read like this :
<clsItem>
<Usernames>
<Username>Willie</Username>
<Username>William</Username>
<Username>Bill</Username>
</Usernames>
</clsItem>


Here is the sample source :
'====================
For Each myRelation In ds.Tables(0).ChildRelations
For Each myRow In ds.Tables(0).Rows
arrRows = myRow.GetChildRows(myRelation)
MessageBox.Show(arrRows.GetLength(0))
ReDim Preserve arrRows(arrRows.GetLength(0))
'How to add a Row into arrRows ???
'How to assign arrRows back into ChildRows ???
Next myRow
Next myRelation
'====================


Thanks for any help or advice.

--
William T
Chief Software Developer
Software Architect
Softwaremaker.Net Pte Ltd

+++++++++++++++++++++++++++++
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top