JConklin

Delete a feature

Discussion created by JConklin on Sep 8, 2011
Latest reply on Sep 8, 2011 by JConklin
I am trying to delete a feature programmatically, and what seems easy is not working properly. 
I have tried several methods all result in the feature being deleted, but not the row in the table.  I then get a failed to draw because there is no shape associated with the row. I tried all three methods below inside and outside of an edit session with the same results. 

Thanks in advance

Justin

 

The feature was created with:

Dim pFeature As IFeature = pFeatureClass.CreateFeature
            pFeature.Shape = pPoint
pFeature.store


I have tried:

pCursor = pFC.Update(pQF, False)
        pFeature = pCursor.NextFeature
pCursor.DeleteFeature()

also tried:

pSelFeats.Search(Nothing, False, pCursor)
        Dim pFeature As IFeature = pCursor.NextFeature
        pFeature.Delete()

also tried:

pSelFeats.Search(Nothing, False, pCursor)
        Dim pFeature As IFeature = pCursor.NextFeature

Dim pRow As IRow = pFeature
        pRow.Delete()

Outcomes