Change the alias name on table

225
2
Jump to solution
3 weeks ago
Labels (2)
MariusN
New Contributor

Using ArcGIS Pro 3.2.2.

Is there a way to update the Alias on a "File Geodatabase Table" using the C# SDK?

Have tried to execute the AlterAliasName

string toolname = "AlterAliasName";
string database = Project.Current.DefaultGeodatabasePath;
string inputTable = Path.Combine(database, tabel);
IReadOnlyCollection<string> parameters = Geoprocessing.MakeValueArray(inputTable, alias);

IGPResult gp_result = await Geoprocessing.ExecuteToolAsync(toolname, parameters);


The gp_result.IsFailed is always true and no additional information is given in the response obj.

0 Kudos
2 Solutions

Accepted Solutions
Aashis
by Esri Contributor
Esri Contributor

Yes, you can by using the SchemaBuilder.Modify in the DDL API.

A quick snippet - 

 

using (Table table = geodatabase.OpenDataset<Table>("TableName"))
using (TableDefinition tableDefinition = table.GetDefinition())
{
  SchemaBuilder sb = new SchemaBuilder(geodatabase);

  TableDescription updateTableDescription = new TableDescription(tableDefinition);
  updateTableDescription.AliasName = "New Alias Name";
  schemaBuilder.Modify(updateTableDescription);

  bool buildStatus = schemaBuilder.Build();
}

 

View solution in original post

MariusN
New Contributor

Thanks  @Aashis The provided code sample works.

View solution in original post

0 Kudos
2 Replies
Aashis
by Esri Contributor
Esri Contributor

Yes, you can by using the SchemaBuilder.Modify in the DDL API.

A quick snippet - 

 

using (Table table = geodatabase.OpenDataset<Table>("TableName"))
using (TableDefinition tableDefinition = table.GetDefinition())
{
  SchemaBuilder sb = new SchemaBuilder(geodatabase);

  TableDescription updateTableDescription = new TableDescription(tableDefinition);
  updateTableDescription.AliasName = "New Alias Name";
  schemaBuilder.Modify(updateTableDescription);

  bool buildStatus = schemaBuilder.Build();
}

 

MariusN
New Contributor

Thanks  @Aashis The provided code sample works.

0 Kudos