CatalogContext.SetJoinTable (String, String, String, CatalogJoinType) Method (BCL)

Use this method to set the join table information. The join information is in effect for the lifetime of the CatalogContext object.

For a list of the methods that support the JoinTable feature, see Code to Join an External Table to Product Recordsets.

[Visual Basic .NET]

Public Sub SetJoinTable( _ByValtargetTableName As System.String, _
  ByValsourceJoinKey As System.String, _
  ByValtargetJoinKey As System.String, _
  ByValjoinType As CatalogJoinType _
) 

[C#]

public void SetJoinTable(System.StringtargetTableName,
  System.StringsourceJoinKey,
  System.StringtargetJoinKey,
  CatalogJoinTypejoinType);

Parameters

[Visual Basic .NET]

  • targetTableName
    The target table. May not be null.
  • sourceJoinKey
    The source join key name. May not be null.
  • targetJoinKey
    The target join key name. May not be null.
  • joinType
    The CatalogJoinType enumeration value. See the Remarks section for possible values.

[C#]

  • targetTableName
    The target table. May not be null.
  • sourceJoinKey
    The source join key name. May not be null.
  • targetJoinKey
    The target join key name. May not be null.
  • joinType
    The CatalogJoinType enumeration value. See the Remarks section for possible values.

Return Value

This method returns void.

Remarks

When the default CatalogContext object is initialized it will set the join table information. You can use SetJoinTable method or the joinTable tag in the web.config file to change join table information. For more information about the joinTable tag, see catalog Tag.

You can create two CatalogContext objects and set different join tables for both of them using the SetJoinTable method. Joins can be performed with multiple tables, but only one table can be joined at a time. The API must be called several times to complete this operation. You cannot perform multiple joins using multiple tags in the web.config file, this can only be done using the SetJoinTable method. As long as the column names in the join table are not the same as the column names in the catalog tables you can specify columns from your join table in the targetJoinKey parameter.

If you pass a parameter containing spaces to the SetJoinTable method, that parameter must be enclosed by square brackets([]).

The following table lists the possible values for the CatalogJoinType enumeration.

Type Description
InnerJoin Returns rows only where the keys are equal.
OuterJoinLeft Returns all rows in the Product Catalog System and matching rows in the target table.
OuterJoinRight Returns matching rows in the Product Catalog System and all rows in the target table.
OuterJoinFull Returns all rows in both tables.
NoJoin Does not perform a join.

Throws an ArgumentNullException if any of the three string parameters are null. Throws a CommerceException on failure.

Requirements

Namespace: Microsoft.CommerceServer.Runtime.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: Microsoft.CommerceServer.Runtime.dll

Copyright © 2005 Microsoft Corporation.
All rights reserved.