Hello,
I am somewhat new to ArcGIS Pro and am in the process of developing a console application using the CoreHost dlls.
Everything has been going smoothly overall so far but I have now run into an issue I would like to ask this fine community about
I've been developing a console application which is creating a geodatabase based on information coming in via XML-files which i am parsing to Features and Shapes.
Creating the geodatabase from scratch was not a problem and it was filled with all 8M features coming in from the XML-files.
Now I want to do another run against the geodatabase to update the features which has changed since I first created the geodatabase and the ArcGIS SDK now suddenly wants me to create an EditOperation for me to be able to update the features?
The EditOperation does not seem to be part of the CoreHost dlls and seem to require the Desktop dlls? Do I really need to drag in all the Desktop dlls just to be able to edit a geodatabase?
The exact error message I am getting is "The current operation requires an edit operation"
Best regards
Lars
Solved! Go to Solution.
Lars,
That error message isn't clear at all. The Geodatabase.Evaluate method uses a QueryDef object to create a virtual table. QueryDefs can reference multiple tables, but the resulting virtual table cannot be edited.
Could you create your cursor by calling Table.Search() instead? This uses what is called a QueryFilter, which can only reference a single table, and is editable. This is the typical pattern used for editing data.
--Rich
Hi Lars,
When editing with CoreHost, you should create an edit operation using Geodatabase.ApplyEdits(). More details are written up .
I hope this helps,
--Rich
Hello Rich Ruh and Sean Jones , thanks for the quick replies!
I did try ApplyEdits at one point but ended up with the same issue, this is what I am currently running with:
Lars,
That error message isn't clear at all. The Geodatabase.Evaluate method uses a QueryDef object to create a virtual table. QueryDefs can reference multiple tables, but the resulting virtual table cannot be edited.
Could you create your cursor by calling Table.Search() instead? This uses what is called a QueryFilter, which can only reference a single table, and is editable. This is the typical pattern used for editing data.
--Rich
Ah, that explains the issue I was having, switched to Table.Search() and now it's working perfectly, thanks alot for the assistance Rich Ruh!