I am using a RowCursor to build a List of Features. In the While loop, my debug statement returns OBJECTIDs 1 and 2, but in the For loop after the RowCursor, the OBJECTIDs are 2 and 2. Why?
Dim mm as MapMember
Dim pPointFeatures As List(Of Feature) = New List(Of Feature)
Dim qf as ArcGIS.Core.Data.QueryFilter
qf.WhereClause = "OBJECTID IN (1, 2)"
Using c As RowCursor = CType(mm, BasicFeatureLayer).Search(qf)
While c.MoveNext
Debug.Print(CType(c.Current, Feature).Item("OBJECTID").ToString())
' Prints 1 and 2
pPointFeatures.Add(CType(c.Current, Feature))
End While
End Using
For Each p In pPointFeatures
Debug.Print(p("OBJECTID").ToString())
' Prints 2 and 2
Next
I