I'm using IDisplayRelationshipClass to create join and delete join.. well, I try, because it's not working at all. Creating join causes deleting each others existing joins and creating new one. Here is my code:IDisplayRelationshipClass displayRelationshipClass = _layer as IDisplayRelationshipClass;
IMemoryRelationshipClassFactory memoryRelationshipClassFactory =
new MemoryRelationshipClassFactoryClass();
IFeatureLayer featureLayer = pOriginLayer as IFeatureLayer;
IObjectClass originObjectClass = featureLayer.FeatureClass;
IFeatureLayer layerTojoin = pLayerToJoin as IFeatureLayer;
IObjectClass objectClassToJoin = layerTojoin.FeatureClass;
IRelationshipClass relationshipClass = memoryRelationshipClassFactory.Open(
"TabletoLayer",
objectClassToJoin,
pFieldToJoin.Name,
originObjectClass,
pOriginField.Name,
"forward",
"backward",
esriRelCardinality.esriRelCardinalityOneToOne);
displayRelationshipClass.DisplayRelationshipClass(
relationshipClass,
pIsKeepAllRecordsChecked ? esriJoinType.esriLeftOuterJoin : esriJoinType.esriLeftInnerJoin);
Why it's not working? I'm doing exactly the same things as in thousands samples..