I have a point feature class A in file gdb and then I created a feature-linked annotation class B.
Then I have made a SDK program to create annotation on B, the program work fine on file gdb. But I copied both A & B to geodatabase on SQL Server, the program failed, 'Objects in this object class cannot be updated outside of an edit session.' is shown.
I found that the error occurred on the code below:
RowBuffer annoBuf = annoFC.CreateRowBuffer();
Feature anFt = annoFC.CreateRow(annoBuf);
AnnotationFeature annoFt = (AnnotationFeature)anFt;
Do anyone have ideas?
Hi,
You need to use EditOperation to work with enterprise geodatabase. Sample here:
Many thx, but my annotation program is a standalone program rather than ArcGIS Pro add-in. How can I add the EditorOperation and inspector objects to my program? Besides, how can I implement desktop objects e.g. inspector, CurrentTemplate in standalone program?
For stand-alone CoreHost applications, calls to editing methods should be enclosed within a call to Geodatabase.ApplyEdits.
Sample here: