rfairhur24

VB.Net ITableSort and QueryFilter SubFields

Discussion created by rfairhur24 on Oct 11, 2012
Latest reply on Oct 12, 2012 by sshetty
ESRI is promoting the use of Subfields on queries to limit the number of fields read by a search cursor to reduce the processing time involved in retrieving data through a cursor.

I just wanted to let others know that I have found a gotcha in VB.NET (VS 2010 with ArcGIS Desktop 10.0) when using the QueryFilter Subfields property in combination with an ITableSort interface.  If the ITableSort's QueryFilter property is set to a QueryFilter that has Subfields specified, the Sort will not return any Rows.  This occurs even if the Subfields list of the QueryFilter is identical to the list that is assigned to the Fields property of the TableSort.  The same behavior occurs when the Cursor that is assigned to the TableSort's Cursor property was originally generated using a QueryFilter that had Subfields specified.

The help for the ITableSort interface says:

"If the IQueryFilter.Subfields property is set, it is ignored as the ITableSort.Fields property always takes precedence."

But based on what I have seen that is apparently not the case, since the only way I have been able to get Rows returned from the ITableSort was to set the input QueryFilter SubFields property to "".

Outcomes