SetByIndex

Sets the value for the corresponding column for the DataRow. If the value for the name exists, the old value is replaced.

Syntax

ASCII Version
int setByIndex(DataRow* dataRow, int index, const char* value) 
Unicode Version
int setByIndex(DataRow* dataRow, int index, const UChar* value) 

Parameters

  • Datarow - the DataRow to which this function applies
  • Column index with which the specified value is to be associated
  • Value to be associated with the specified name

Exceptions

  • The column index is invalid

Results

Returns 0 if successful or error code.

Example

ASCII Version
int nRet; 
nRet= setByIndex (dataRow, 1, "Austin"); 
if(nRet != SUCCESSFUL_RETURN) 
{ 
printf(getErrorMessage(nRet)); 
 //more code 
}
Unicode Version
int nRet; 
UChar* error; 
UChar columnValue[64]; 
char* columnValueStr= "Austin"; 
u_charsToUChars(columnValueStr,	columnValue, strlen(columnValueStr)); 
columnValue [strlen(columnValueStr)]=0; 
nRet= setByIndex (dataRow, 1, columnValue); 
if(nRet != SUCCESSFUL_RETURN) 
{ 
error	= getErrorMessage(nRet); 
//more code 
}