ArcGIS Pro SDK: Create and add new standalone table

1509
6
01-13-2020 06:27 AM
BobTaylor
New Contributor II

Hi, I'm using ArcGIS Pro SDK in Visual Studio 2019. I am able to get a list of selected standalone tables using the MapView.Active.GetSelectedStandaloneTables() but i would also like to create and  add new standalone tables to ArcGIS Pro. How would i go about doing that using the SDK? Thanks for your help - Bob

0 Kudos
6 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

The ArcGIS.Core.Data API is a DML-only (Data Manipulation Language) API. This means that all schema creation and modification operations such as creating tables and feature classes, creating and modifying fields, enabling attachments, and so on, need to be performed using the Geoprocessing API.  The specific geo processing tool you need to create a table is: management.CreateTable.  If you don't want to use a template table to create the required fields you have to add the fields after the create table geoprocessing tool is finished.  Here is an example showing how to add or delete fields to an existing table: https://github.com/esri/arcgis-pro-sdk-community-samples/tree/master/Geodatabase/AddDeleteFieldToFro...

0 Kudos
BobTaylor
New Contributor II

Thank you for your help Wolfgang. I will look through the links you provided.

Bob

0 Kudos
BobTaylor
New Contributor II

Is this just for Python or is there a C# example?

Bob

0 Kudos
RichRuh
Esri Regular Contributor

Hi Bob,

It's buried in a utility network sample, but check out this C# file: arcgis-pro-sdk-community-samples/CategoriesComboBox.cs at master · Esri/arcgis-pro-sdk-community-sam... 

  • Starting at line 192 is some code to create a table in the geodatabase using the geoprocessing APIs.
  • Starting at line 282, the code shows how to create a `StandaloneTable` from a geodatabase table.
  • Starting at line 292, the code shows how to open a table view of that standalone table.

I hope this helps some.  We are actively working on adding some simple DDL operations directly in the Pro C# SDK for a future release.

--Rich

0 Kudos
BobTaylor
New Contributor II

Thank you very much. This information was very helpful !

Bob

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

FYI: We are also working on adding c# usage and examples to the ArcGIS Pro geoprocessing tools documentation (in addition to the python documentation we have right now) for one of the upcoming releases (post 2.5).

0 Kudos