AddChild

Ajoute un nouveau DataRow à la relation nommée parent/enfant. Si la relation nommée existe, le DataRow fourni sera ajouté à la collection de DataRow existante. Sinon, une nouvelle collection sera créée avec le DataRow fourni comme son seul élément.

Syntaxe

Version ASCII
void addChild(DataRow* dataRow, const char* childName, DataRow* childDataRow) 
Version Unicode
void addChild(DataRow* dataRow, const UChar* childName, DataRow* childDataRow) 

Paramètres

  • Le nom de la relation parent/enfant (par ex., « Données de plaine inondable », « Références », « Utilisé par » et ainsi de suite)
  • Le DataRow à ajouter à la relation

Exemple

Version ASCII
DataRow* dataRow = createDataRow();			
DataRow* child1DataRow1 = createDataRow();	 

setByName(child1DataRow1, "City", "Austin"); 
setByName(child1DataRow1, "State", "Texas"); 
 
addChild( dataRow, "child1", child1DataRow1);
Version Unicode
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);