public new AttributedRelationship CreateRelationship( Row originRow, Row destinationRow )
Public Overloads Shadows Function CreateRelationship( _ ByVal originRow As Row, _ ByVal destinationRow As Row _ ) As AttributedRelationship
public new AttributedRelationship CreateRelationship( Row originRow, Row destinationRow )
Public Overloads Shadows Function CreateRelationship( _ ByVal originRow As Row, _ ByVal destinationRow As Row _ ) As AttributedRelationship
Exception | Description |
---|---|
System.ArgumentException | originRow or destinationRow is null. |
ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
For relationships of type RelationshipCardinality.OneToOne, RelationshipCardinality.OneToMany and RelationshipCardinality.ManyToMany that have user-attributes defined (vs. system generated), an intermediate table will be created to store relationships between the rows with corresponding origin foreign and destination foreign key values.
When calling CreateRelationship(Row,Row) on an intermediate table that has user-defined attributes defined, the origin row's primary key value will be written into the field specified by AttributedRelationshipClassDefinition.GetDestinationKeyField in the intermediate table. Likewise, the destination row's primary key value will be written into the field specified by AttributedRelationshipClassDefinition.GetDestinationForeignKeyField in the intermediate table. Therefore it is possible that you could overwrite, and therefore delete, an existing relationship. However, all the user-defined fields will remain unpopulated. To populate the user-defined fields in the intermediate table, you should use the overloaded CreateRelationship(Row,Row,RowBuffer) instead.
For relationships of type RelationshipCardinality.ManyToMany that do not have user-defined attributes, you should use this version rather than CreateRelationship(Row,Row,RowBuffer) since there are no additional attributes to be populated in the intermediate table.
Target Platforms: Windows 11, Windows 10