AddChild
Fügt der benannten übergeordneten/untergeordneten Beziehung eine Datenzeile (DataRow) hinzu. Wenn die benannte Beziehung vorhanden ist, wird die angegebene Datenzeile (DataRow) der vorhandenen Datenzeilensammlung angefügt. Anderenfalls wird eine neue Sammlung mit der angegebenen Datenzeile (DataRow) als einziges Element erstellt.
Syntax
void addChild(DataRow* dataRow, const char* childName, DataRow* childDataRow)
void addChild(DataRow* dataRow, const UChar* childName, DataRow* childDataRow)
Parameter
- Der Name der übergeordneten/untergeordneten Beziehung (z. B. „Überschwemmungsgebietsdaten“, „Referenzen“, „Verwendet von“ usw.)
- Die Datenzeile (DataRow), die der Beziehung hinzugefügt werden soll.
Beispiel
DataRow* dataRow = createDataRow();
DataRow* child1DataRow1 = createDataRow();
setByName(child1DataRow1, "City", "Austin");
setByName(child1DataRow1, "State", "Texas");
addChild( dataRow, "child1", child1DataRow1);
UChar* convertcharToUChar( char* name, UChar* value)
{
int lenName= strlen(name);
u_charsToUChars(name, value, lenName );
value[ lenName]=0;
return value;
} >
DataRow* dataRow = createDataRow();
DataRow* child1DataRow1 = createDataRow();
UChar name[128];
UChar columnValue[128];
setByName(child1DataRow1, convertcharToUChar("City", name),
convertcharToUChar("Austin", columnValue));
setByName(child1DataRow1, convertcharToUChar("State", name),
convertcharToUChar("Texas", columnValue));
addChild( dataRow, "child1", child1DataRow1);