How do I insert a row into a table with the ArcGIS Pro SDK?

3287
1
09-05-2017 03:08 PM
mfcallahan
Occasional Contributor II

I need to insert a new row into a featureless table in a file geodatabase, but I can't seem to find anything the ArcGIS Pro SDK community samples or pro snippets.  Does anybody know how this can be done and/or can point me in the right direction?

0 Kudos
1 Reply
CharlesMacleod
Esri Regular Contributor

Hi Matthew, the simplest way, and recommended way, is to use EditOperation.Create. https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#edit-operation-create-features. This assumes you have a layer or standalone table sourcing your feature class or table.

If you have a mix of GIS and non-GIS data, you must use EditOperation.Callback. https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase#creating-a-row. This would also work for a scenario where you do not have a layer (or standalone table).

[If you cannot use EditOperation (eg you are writing a console program) you should use Geodatabase.ApplyEdits. http://pro.arcgis.com/en/pro-app/sdk/api-reference/#topic7093.html]