public void LoadByRow(SQLiteResultSet.Row row)
{
RetrievalInProcess = true;
ReadOnlyCollection<DBField> fieldList = DBField.GetFieldList(this.GetType());
// load each field one at a time. they should have been retrieved in the
// ordering in FieldList
int i;
for (i = 0; i < fieldList.Count; i++) {
if (row.fields[i] == "")
fieldList[i].SetValue(this, null);
else
fieldList[i].SetValue(this, row.fields[i]);
}
// id is always at the end, assign that too
id = int.Parse(row.fields[i]);
// all values are in sync with DB so no commit needed.
commitNeeded = false;
RetrievalInProcess = false;
}