Share via


ProductCatalog3.GetCategory Method (PIA)

Use this method to retrieve the specified category from a catalog.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Function GetCategory(strCategoryName As String) As ICategory

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public ICategory GetCategory(stringstrCategoryName);

Parameters

[Visual Basic .NET]

  • strCategoryName
    A String that contains the name of the category to be returned.

[C#]

  • strCategoryName
    A string that contains the name of the category to be returned.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns the ICategory interface to the Category object specified.

[C#] This method returns an ICategory interface used to return the specified category.

Exceptions

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

The following table shows the custom COM errors that COMException may wrap as exceptions for this method.

Constant Value Description
E_POINTER

[C#] 0x80004003

[Visual Basic .NET] &H80004003

The pointer is invalid.
E_CAT_INVALID_PARAMETER

[C#] 0x889800B6

[Visual Basic .NET] &H889800B6

The input parameter <parameter number> is invalid.
S_FALSE 1 The category does not exist

[Visual Basic .NET]

Example

oMyCategory = myProductCatalog.GetCategory("Apparel")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

ProductCatalog3 Class

ProductCatalog3.CreateCategory

ProductCatalog3.DeleteCategory

Copyright © 2005 Microsoft Corporation.
All rights reserved.