wei_ler

InsertRow on Cursor returns error after stopping an EditOperation and Start a new one

Discussion created by wei_ler on Mar 2, 2011
Latest reply on Mar 10, 2011 by wei_ler
Hello,
i am trying to migrate Code from AG 9.3 with VS 2005 to AG 10 with VS 2010. In AG 10 i have the following Problem:
'I create a reference to a FeatureTable and Cursor: (this is done outside of the edit session)

FLSTSLnkTable = DBConnection.newpGDBCon.GetFeatureTable("w_Lnk_FLS_TS")
FLSTSLnkCursor = FLSTSLnkTable.Insert(False)

'After that I start the EditSession and an Editoperation:

aoiWorkspaceEdit.StartEditing(True)
aoiWorkspaceEdit.StartEditOperation()

'in this EditOperation i use the InsertRow into the FeatureTable via the cursor and rowbuffer:

Dim myRowBuffer As IRowBuffer
myRowBuffer = FLSLnkTable.CreateRowBuffer
Dim myRow As IRow
myRow = myRowBuffer
Try
    With myRow
         .Value(.Fields.FindField(LnkFLSIdName)) = FeatFeldId
         .Value(.Fields.FindField(LnkSonstIdName)) = Me.ID
         .Value(.Fields.FindField("Flaechenanteil")) = myIntersectArea / 10000
    End With
    FLSLnkCursor.InsertRow(myRowBuffer)
Catch ex As Exception
    MsgBox(ex.Message, MsgBoxStyle.Critical)
    Exit Sub
End Try

'then i stop the edit operation:

aoiWorkspaceEdit.StopEditOperation()

'after that i start a new EditOperation:

aoiWorkspaceEdit.StartEditOperation()

'and then i try to insert another row into the FeatureTable via the cursor and rowbuffer:
and here i get the following error when it comes to the line "FLSLnkCursor.InsertRow(myRowBuffer)":
"The cursor has been invalidated because the edit operation has stopped."

In ArcGIS 9.3 this worked fine. Is there a change in which order i do the reference to the objects in ArcGIS 10? Does someone have a hint how to deal with this error?
Thanks in advance.

Greetings Karin

Outcomes