Share via


CatalogSets.CreateCatalogSet Method (PIA)

Use this method to create a new catalog set in the catalog database.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
Imports ADODB26Lib     ‘ for _Recordset
…
Public Function CreateCatalogSet(
  CatalogSetName As String,
  CatalogSetDescription As String,
  bWildCard As Boolean,
  Optional CatalogNamesRS As _Recordset
) As String

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
using ADODB26Lib;                              //For _Recordset
…
public string CreateCatalogSet(stringCatalogSetName,
  stringCatalogSetDescription,
  boolbWildCard,
  _RecordsetCatalogNamesRS);

Parameters

[Visual Basic .NET]

  • CatalogSetName
    A String that contains a name for the new catalog set. The maximum length is 128 characters.
  • CatalogSetDescription
    A String that contains a description of the new catalog set.
  • bWildCard
    A Boolean that indicates whether this catalog set should automatically include all catalogs, including any new catalogs that might be created in the future. A value of True indicates that this catalog set includes all existing catalogs. A value of False indicates that this catalog set only includes a specific set of catalogs.
  • CatalogNamesRS
    The _Recordset interface of a Recordset object that specifies the catalogs to be included in the new catalog set. The Recordset object should contain a single column named CatalogName, and one row per catalog to be included. If the bWildCard parameter is True, then this parameter will be ignored.

[C#]

  • CatalogSetName
    A string that contains a name for the new catalog set. The maximum length is 128 characters.
  • CatalogSetDescription
    A string that contains a description of the new catalog set.
  • bWildCard
    A bool that indicates whether this catalog set should automatically include all catalogs, including any new catalogs that might be created in the future. A value of True indicates that this catalog set includes all existing catalogs. A value of False indicates that this catalog set only includes a specific set of catalogs.
  • CatalogNamesRS
    An ActiveX Data Objects (ADO) ADODB26Lib._Recordset interface to a Recordset object that specifies the catalogs to be included in the new catalog set. The Recordset object should contain a single column named CatalogName, and one row per catalog to be included. If the bWildCard parameter is true, then this parameter will be ignored and a value of Type.Missing can be used

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a String that contains the ID of the new catalog set.

[C#] This method returns a string containing the automatically generated ID (GUID) of the new catalog set.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

[Visual Basic .NET]

Example

'The following example shows the creation of a catalog set 
'associated with all the catalogs in the catalog management system.
strCatalogSetID = myCatalogSets.CreateCatalogSet( _
  "PremiumCatalogs", "Premium catalog set", True)

'The following example shows the creation of a catalog set 
'associated with two specific catalogs.
rsCatalogNames = New Recordset()
rsCatalogNames.Fields.Append("CatalogName", DataTypeEnum.adBSTR)
rsCatalogNames.Open()
rsCatalogNames.AddNew()
rsCatalogNames.Fields("CatalogName").Value = "Catalog1"
rsCatalogNames.Update()
rsCatalogNames.AddNew()
rsCatalogNames.Fields("CatalogName").Value = "Catalog2"
rsCatalogNames.Update()

strCatalogSetID = myCatalogSets.CreateCatalogSet( _
  "CombinedCatalog", "A one and a two", False, rsCatalogNames)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cs_ctlgsets (in cs_ctlgsets.dll)

See Also

CatalogSets Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.