There is a good solution to this problem in the new IQueryFilterDefinition2 interface in 10.1. I can confirm that this works for file geodatabases and performs well. IQueryFilter2 query = new QueryFilterClass(); query.WhereClause = whereClause; query.SubFields = distinctColumn; IQueryFilterDefinition2 queryDef = (IQueryFilterDefinition2)query; string prefixTemplate = "DISTINCT {0}"; queryDef.PrefixClause = String.Format(prefixTemplate, distinctColumn); string postfixTemplate = "ORDER BY {0}"; queryDef.PostfixClause = String.Format(postfixTemplate, distinctColumn);
IQueryFilter2 query = new QueryFilterClass(); query.WhereClause = whereClause; query.SubFields = distinctColumn; IQueryFilterDefinition2 queryDef = (IQueryFilterDefinition2)query; string prefixTemplate = "DISTINCT {0}"; queryDef.PrefixClause = String.Format(prefixTemplate, distinctColumn); string postfixTemplate = "ORDER BY {0}"; queryDef.PostfixClause = String.Format(postfixTemplate, distinctColumn);
string prefixTemplate = "DISTINCT {0}"; queryDef.PrefixClause = String.Format(prefixTemplate, distinctColumn);
You guys rock. Getting rid of IDataStatistics in our add-in saved us many hours of Arcmap re-installs. I gave up trying to find the cause of our crashes until finding this thread. I would of never tracked it down myself. Thank you for posting your findings.
I tried searching for this bug, but cannot find it. Where is it?
It will not show straight away. When a bug is raised it is only visible by the support team in the US initially and then once the development team that will actually fix the code has verified it then it will be marked to be visible by others.This can take varying amounts of time as if they are trying to investigate workarounds etc it may not be visible until they have finished the in-depth investigation.
I'm sure that in ESRI imeplementation of IDataStatistics or in combination with IEnumerator is a memory leak.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.