SetByName
Sets the value for the corresponding column for the DataRow. If the value for the name exists, the old value is replaced.
Syntax
int setByName(DataRow* dataRow, const char* name, const char* value)
int setByName(DataRow* dataRow, const UChar* name, const
UChar* value)
Parameters
- Datarow - the DataRow to which this function applies
- Name with which the specified value is to be associated
- Value to be associated with the specified name
Exceptions
If input Blank column name or Duplicate column name, return error
Results
Returns 0 if successful or error code.
Example
int nRet;
nRet= setByName (dataRow, "City", "Austin");
if(nRet != SUCCESSFUL_RETURN)
{ printf(getErrorMessage(nRet));
//more code
}
int nRet;
UChar* error;
UChar columnName[64];
char* columnNameStr= "City"
UChar columnValue[64];
char* columnValueStr= "Austin";
u_charsToUChars(columnNameStr, columnName, strlen(columnNameStr));
columnName [strlen(columnNameStr)]=0;
u_charsToUChars(columnValueStr, columnValue, strlen(columnValueStr));
columnValue [strlen(columnValueStr)]=0;
nRet= setByName (dataRow, columnName, columnValue);
if(nRet != SUCCESSFUL_RETURN)
{ error = getErrorMessage(nRet);
//more code
}