Select to view content in your preferred language

How to assign domain.

2450
2
10-20-2015 02:35 AM
PankajTyagi
New Contributor II

I am creating new gdb file from one GDB file. I am trying to assign the domain of the fields in newly created feature class from the gdb file.

How to assign the domain to a field because I tried "pfieldedit.domain_2 = FeatClass.Fields.get_Field(i).Domain. It shows the domain values while I am creating the new feature class but when I checked the data I did not found any domain in fields of the feature class.

Tags (1)
0 Kudos
2 Replies
FreddieGibson
Regular Contributor II

You'll need to modify the schema for the dataset via IClassSchemaEdit to persist the change. This should be documented on the following page.

Assigning domains to fields

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Assigning_domains_to_fields/0001...

DuncanHornby
MVP Notable Contributor

An alternative method would be to call the Assign Domain to field tool​ through the IGeoProcessor object. There are many examples in the help or on the internet showing how to call such tools.