IRelateInfo Interface

Provides access to members that describe a relate.

Members

Name Description
Read-only property Name The name of the relationship to a table.
Read-only property RelatedTableID ID of the table related to.
Read-only property RelationshipID Identifies the specific relationship for a related table.

IRelateInfo.Name Property

The name of the relationship to a table.

Public ReadOnly Property Name As String
public string Name {get;}

Remarks

For Geodatabase relationship class, the name is either the backward or forward label.

For relationship that is created in map, the name is same the table/layer it is related to.

IRelateInfo.RelatedTableID Property

ID of the table related to.

Public ReadOnly Property RelatedTableID As Integer
public int RelatedTableID {get;}

IRelateInfo.RelationshipID Property

Identifies the specific relationship for a related table.

Public ReadOnly Property RelationshipID As Integer
public int RelationshipID {get;}

Description

It is an integer that uniquely identifies all relationship available in the source map document.

Classes that implement IRelateInfo

Classes Description
RelateInfo A colcass that contains the infromation about the relate.

Remarks

If a layer or a standalonetable participates in a relationship, MapServer advertises that by populating those information as RelateInfo.

When there are more than one relationships exist between the same source and destination table(s) or layer(s), RelationshipID can be used to uniquely identify a relationship.

Example: Printing a list of all relates a layer or standalonetable is participating



Assuming pMTI is a MapTabeInfo passed in to this function

IRelateInfos pRIs = null; 

IRelateInfo pRI = null;



pRIs = pMTI.RelateInfos;



if (pRIs == null) 

{

  Console.WriteLine(No relationship is available�); 

  return;

}

for (int j = 0; j < pRIs.Count; j++)

{

  pRI = pRIs.get_Element(j);

  Console.WriteLine(pRI.Name +, " + pRI.RelationshipID +,+ pRI.RelatedTableID + �\n�);

}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.