What gives with UpdateSearchedRows?

Discussion created by Grieck on Aug 3, 2011
Latest reply on Feb 14, 2012 by Grieck

I'm using ITable.UpdateSearchedRows and I have a sub field define and my query filter defined so it should only update a  single field on a single row within the given table. However, it's replacing all the fields in the row with null values except the defined sub field. Why is it setting all other fields not included in the sub field to null? I was under the impression that this would just update the specified sub field.

I've included a rough example of my code:

The where clause doesn't contain the field I'm updating but rather includes the fields to find the row where the totallength  should be updated.

ITable tab = GetTable(MyTable);
int totallengthfieldindex = tab.FindField("totallength");
IQueryFilter2 qf2 = new QueryFilterClass();
IRowBuffer buff = tab.CreateRowBuffer();
TotalLength = CalcValue();
qf2.WhereClause = "field = 'myfield' and field2 = " + myfield2 + " and field3 = " + field3value;
qf2.SubFields = "totallength";
buff.set_Value(totallengthfieldindex, TotalLength);
tab.UpdateSearchedRows(qf2, buff);