I have a script in VB.Net for grabbing values from one feature and assigning them to another. It works fine on shapefiles, but upon importing the same shapefiles into a file geodatabase, I get an error thrown at me.
Try
'Start edit operation
pEditor.StartOperation()
'Update the new fields with the correct values
pFeature.Value(pFeature.Fields.FindField("ReachCode")) = strReach
pFeature.Value(pFeature.Fields.FindField("Measure")) = dblMeas
pFCursor.UpdateFeature(pFeature)
'End edit operation
pEditor.StopOperation("UpdateFields")
pFeature = pFCursor.NextFeature
Catch e As Exception
'Cancel edits and exit loop
pEditor.AbortOperation()
MsgBox("There has been an error... edits will not be saved.", MsgBoxStyle.Exclamation, "Error")
pEditor.StopEditing(False)
Exit Sub
End Try
The loop is an update cursor for the feature class. When working in the geodatabase, the first update is applied fine, but when it reaches the "pFCursor.UpdateFeature(pFeature)" in the second loop, it throws this error:
"The cursor has been invalidated because the edit operation has stopped"
Is there some syntax change when working in geodatabases with respect to starting and stopping editing operations?