大家好,我已经创建了一个代码,复制功能类和表,然后复制它们之间的现有关系。工作流程如下:复制整柜和表2。对于每个fcl或表,我复制关系3的信息。然后,我使用以下代码IFields campiattribut= null为重复的fcl或表创建关系;if (relationshipEsistente. isattributedrelationshipclass) {try {ITable table = (AttributedRelationshipClass)relationshipEsistente as atable;campiattribution = table.Fields;} catch (Exception ee) {}} try {IRelationshipClass relClass = featureWorkspace。CreateRelationshipClass (nomeRelazione, (IObjectClass)featureWorkspace。开放Table(nome + "__" + nomeTabellaOrig), (IObjectClass)featureWorkspace.OpenTable(nome + "__" + nomeTabellaDest), relationshipEsistente.ForwardPathLabel, relationshipEsistente.BackwardPathLabel, relationshipEsistente.Cardinality, relationshipEsistente.Notification, relationshipEsistente.IsComposite, relationshipEsistente.IsAttributed, campiAttributed, relationshipEsistente.OriginPrimaryKey, relationshipEsistente.DestinationPrimaryKey, relationshipEsistente.OriginForeignKey, relationshipEsistente.DestinationForeignKey); } The problem is this, the 1:1 and 1:N relationship are replicated correctly, the attributed relationship N:M with additional attributes is created correctly but is empty. I found out this problem because I can't navigate between objects in the fcl and table, than I inspected the relationship with the tool Make Query Table (Data Management) and it is empty. Should I use an alternative way? Thank you.
...查看更多