ICursor issue in 10.1 SP-1

3949
13
Jump to solution
11-08-2012 12:35 PM
ShawnShepard
New Contributor III
I have used the code below for a few years in an ArcGIS Engine application we have developed.  Essentailly it builds a sorted IEnumerator of unique values from a specific field in a layers attribute table.  It has worked fine for years however after upgrading to SP-1 of 10.1 running it consecutivly three times to build three differant lists of values it causes our application to crash.  The crash seems to happed a few seconds after we step through the last IEnumerator to populate a listbox.

Am I missing somthing here?  The crash is an "nt.dll" error in a standard windows error box.

private IEnumerator getSortedList(string mField, ILayer mLayer, string whereclause)         {             IQueryFilter mQFilter = new QueryFilterClass();             mQFilter.WhereClause = whereclause;             IEnumerator mEnumstreets = null;             if (mLayer != null)             {                 IFeatureLayer mFeatureLayer = (IFeatureLayer)mLayer;                 IFeatureClass pFeatureClass = mFeatureLayer.FeatureClass;                 if (pFeatureClass != null)                 {                         ITable pTable = (ITable)pFeatureClass;                         IFeatureCursor pCursor = pFeatureClass.Search(mQFilter, true);                          ITableSort mTableSort = new TableSortClass();                         mTableSort.Table = pTable;                         mTableSort.Fields = mField;                         mTableSort.set_Ascending(mField, true);                         mTableSort.QueryFilter = mQFilter;                         mTableSort.Sort(null);                          IDataStatistics mDataStats = new DataStatisticsClass();                         mDataStats.Cursor = mTableSort.Rows;                         mDataStats.Field = mField;                         mEnumstreets = mDataStats.UniqueValues;                         pCursor = null;                 }             }             return mEnumstreets;         }
Reply
0 Kudos
13 Replies
AdhimoolamD
New Contributor

one more fix....line 21 in the property method UniqueValues

If row.Value(iField) isnot DBNull.value andalso dc.ContainsKey(row.Value(iField)) = False Then

dic.Add(row.Value(iField),"")

end if

Reply
0 Kudos
ErnieSalazar
New Contributor III
Thanks for all of the good info guys.  I am have the same problem with 10.1 in SP1.

Is anyone from ESRI reading this?  Since its been 3 months since the issue was acknowledged, can we get at least a yes or know if it will be fixed?  If it will be, would appreciate any info on when.  If not, please tell us so we can make other arrangements.

I could implement the work around but that is going to require some significant beta testing before I release it to the wild since it is a critical part of the code we have.  Hate to do if it a fix is in the works.

Thanks
Ernie
Reply
0 Kudos
CraigFoot
New Contributor
Ernie,

We've had the same issue, and our testing on 10.2 confirms that, for us at least, this issue was resolved in that version. This release notes link for 10.2 comes from another post:

http://downloads.esri.com/support/downloads/other_/102-IssuesAddressedList.pdf (See issue NIM087476)

Craig
Reply
0 Kudos
DavidWilton
Occasional Contributor
Here is a link to the bug in Nimbus. I'd really like to see a 10.1 SP or patch for this but It seems it's only resolved in 10.2 at the moment. As it's listed as resolved I doubt that is going to happen though.
Reply
0 Kudos