Share via


GetProperties Method (String)

Returns a CatalogPropertiesDataSet containing information about all the properties in the catalog system that match the specified search clause.

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

Syntax

'Declaration
Public Function GetProperties ( _
    searchClause As String _
) As CatalogPropertiesDataSet
'Usage
Dim instance As CatalogContext
Dim searchClause As String
Dim returnValue As CatalogPropertiesDataSet

returnValue = instance.GetProperties(searchClause)
public CatalogPropertiesDataSet GetProperties(
    string searchClause
)
public:
CatalogPropertiesDataSet^ GetProperties(
    String^ searchClause
)
public function GetProperties(
    searchClause : String
) : CatalogPropertiesDataSet

Parameters

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

Return Value

Type: Microsoft.CommerceServer.Catalog..::.CatalogPropertiesDataSet
A CatalogPropertiesDataSet containing information about all the matching properties in the catalog system and their attributes.

Remarks

The CatalogPropertiesDataSet contains all the attributes for all the matching properties in the catalog system. If searchClause is nullNothingnullptra null reference (Nothing in Visual Basic) then this method returns all the properties 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 = @"\[PropertyName\] LIKE N'%MyProperty%'"; You can also specify multiple conditions in the search clause by using valid SQL operators. example string searchClause = @"\[PropertyName\] LIKE N'%MyProperty%' OR \[IsSearchable\]=1";

Examples

This example shows how to get all the properties in the catalog system that begin with Desc and access their attributes.

private void GetProperties(CatalogContext catalogContext)
{
  string searchClause = @"[PropertyName] LIKE N'Desc%'";
  CatalogPropertiesDataSet catalogProperties = catalogContext.GetProperties(searchClause);
  foreach(CatalogPropertiesDataSet.CatalogProperty catalogProperty in catalogProperties.CatalogProperties)
  {
    string propertyName = catalogProperty.PropertyName;
    string displayName = catalogProperty.DisplayName;
  }
}

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

GetProperties Overload

Microsoft.CommerceServer.Catalog Namespace