Partilhar via


GetDefinitions Method (String)

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Returns a CatalogDefinitionsDataSet containing all the definitions in the catalog system that match the search clause.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Function GetDefinitions ( _
    searchClause As String _
) As CatalogDefinitionsDataSet
'Usage
Dim instance As CatalogContext
Dim searchClause As String
Dim returnValue As CatalogDefinitionsDataSet

returnValue = instance.GetDefinitions(searchClause)
public CatalogDefinitionsDataSet GetDefinitions(
    string searchClause
)
public:
CatalogDefinitionsDataSet^ GetDefinitions(
    String^ searchClause
)
public function GetDefinitions(
    searchClause : String
) : CatalogDefinitionsDataSet

Parameters

  • searchClause
    Type: System..::.String
    The criteria, the search clause to filter the catalogs.

Return Value

Type: Microsoft.CommerceServer.Catalog..::.CatalogDefinitionsDataSet
A CatalogDefinitionsDataSet containing all the definitions in the catalog system that match the searchClause.

Remarks

This method returns the category and/or product definitions in the catalog system that match the search clause specified by searchClause. If searchClause is nullNothingnullptra null reference (Nothing in Visual Basic) then this method returns all the definitions in the catalog system. Any columns used in the search clause should be surrounded by square brackets. Any string values referenced in the search clause should be prefixed by N to allow searching Unicode data. example string searchClause = @"\[DefinitionName\] LIKE N'%MyDefinition%'"; You can also specify multiple conditions in the search clause by using valid SQL operators. example string searchClause = @"\[DefinitionName\] LIKE N'%MyDefinition%' OR \[DefinitionType\]=1";

Examples

This example describes how to retrieve the definitions beginning with 'Category' in the catalog system and access the properties on the CatalogDefinitionsDataSet object.

using System;
using Microsoft.CommerceServer.Catalog;
private void GetDefinitions(CatalogContext catalogContext)
{
  string searchClause = @"[DefinitionName] LIKE N'%Category%'";
  CatalogDefinitionsDataSet catalogDefinitions = catalogContext.GetDefinitions(searchClause);
  foreach(CatalogDefinitionsDataSet.CatalogDefinition catalogDefinition in catalogDefinitions.CatalogDefinitions)
  {
    string definitionName = catalogDefinition.DefinitionName;
    CatalogDefinitionType catalogDefinitionType = (CatalogDefinitionType)catalogDefinition.DefinitionType;
    string userDefinedDefinitionAttribute = (string)catalogDefinition["UserDefinedDefinitionAttributeName"];
  }
}

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

GetDefinitions Overload

Microsoft.CommerceServer.Catalog Namespace