AnsweredAssumed Answered

File GDB feature class editing problem

Question asked by daitam on Mar 22, 2013
Latest reply on Apr 4, 2013 by daitam
I'm trying to add new feature to file GDB feature class and keep getting this error: Objects in this class cannot be updated outside an edit session. Feature class has attachments enabled (exists relationships). Googled alot about this problem and still can't figure it out. FYI I'm developing a standalone application. Any thougts? My code:
[PHP]
Public Shared Sub CreateFeature(ByVal workspace As IWorkspace, ByVal featureClass As IFeatureClass, ByVal point As ArcGIS.Geometry.IPoint, ByVal data As String)
        Dim workspaceEdit As IWorkspaceEdit = CType(workspace, IWorkspaceEdit)
        workspaceEdit.StartEditing(True)
        workspaceEdit.StartEditOperation()
        Dim featureBuffer As IFeatureBuffer = featureClass.CreateFeatureBuffer()
        Dim featureCursor As IFeatureCursor = featureClass.Insert(True)
        Dim featureOID As Object
        featureBuffer.Value(featureBuffer.Fields.FindField("Data")) = data
        featureBuffer.Shape = point
        featureOID = featureCursor.InsertFeature(featureBuffer)
        featureCursor.Flush()
        workspaceEdit.StopEditOperation()
        workspaceEdit.StopEditing(True)
    End Sub
[/PHP]

Thanks in advance :)

Outcomes