CatalogRelationshipsDataSet
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
The CatalogRelationshipsDataSet class contains information about the category and product relationships for a catalog item. You can access the DataRowCollection of the dataset’s data table by using the CatalogRelationships property. You can access each row in the collection by using the properties of the CatalogRelationshipsDataSet..::.CatalogRelationship class.
The following table contains the strongly typed properties in this dataset.
Property |
Description |
---|---|
Gets or sets an integer value that specifies the class type of the catalog item. This property is one of the values of the CatalogClassTypes enumeration. The possible values for this property are as follows:
|
|
Gets or sets a string that specifies the display name of the related item. |
|
Gets or sets a decimal value that specifies the list price of the related item. |
|
Gets or sets an integer value that specifies the rank of the related item. |
|
Gets or sets a string that specifies the relationship description in the current active language; maximum length is 256 characters. This property returns an empty string if the relationship does not have a description. |
|
Gets or sets the name of the relationship as a string; maximum length is 128 characters. |
|
Gets the target catalog name for the relationship as a string; maximum length is 85 characters. |
|
Gets the name of the target category for category relationships as a string; maximum length is 128 characters. This property returns null for product relationships. |
|
Gets the related product identifier for product relationships as a string; maximum length is 256 characters. This property returns null for category relationships. |
Constraints
The CatalogRelationshipsDataSet class defines constraints on the RelationshipDescription, RelationshipName, TargetCatalogName, TargetCategoryName, and TargetProductId columns.
Using the CatalogRelationshipsDataSet Class
The following example demonstrates how to access the properties of the CatalogRelationshipsDataSet class.
public static void UseDataset(CatalogContext context, string catalogName, string categoryName)
{
// Get an existing product catalog.
ProductCatalog productCatalog = catalogContext.GetCatalog(catalogName);
// Get a category in the catalog.
Category category = productCatalog.GetCategory(categoryName);
CatalogRelationshipsDataSet categoryRelationships = category.RelatedCategories;
// Get the attributes for the first row of data.
CatalogRelationshipsDataSet.CatalogRelationship categoryRelationship = categoryRelationships.CatalogRelationships[0];
string targetCatalog = categoryRelationship.TargetCatalogName;
string targetCategory = categoryRelationship.TargetCategoryName;
string relationshipName = categoryRelationship.RelationshipName;
string relationshipDescription = categoryRelationship.RelationshipDescription;
// Iterate through the dataset and access the attributes.
foreach(CatalogRelationshipsDataSet.CatalogRelationship relationship in category.RelatedCategories.CatalogRelationships)
{
targetCatalog = relationship.TargetCatalogName;
targetCategory = relationship.TargetCategoryName;
relationshipName = relationship.RelationshipName;
relationshipDescription = relationship.RelationshipDescription;
}
}
The CatalogRelationshipsDataSetSchema Class
The CatalogRelationshipsDataSetSchema class provides constants for all the built-in columns in the dataset and defines all the associated methods. The following table contains the associated methods for this class.
Method |
Description |
---|---|
Returns true if the columnName in the dataset cannot be updated, or false if the columnName in the dataset can be updated. |
|
Returns true if the columnName is a built-in column in the dataset, or false if the columnName is a user-defined property. |