Share via


ProductCatalog3.GetProduct Method (PIA)

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

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Function GetProduct(varProductID As Object) As IProduct

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public IProduct GetProduct(object varProductID);

Parameters

[Visual Basic .NET]

  • varProductID
    An Object that contains the unique identifier of the product.

[C#]

  • varProductID
    An object that contains the unique identifier of the product.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an IProduct interface to the product specified.

[C#] This method returns an IProduct interface to a Product.

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_PRODUCTID

[C#] 0x8898005B

[Visual Basic .NET] &H8898005B

The value you specified for the ProductID is blank or exceeds the maximum allowed length of 256 characters.
E_CAT_INVALID_PARAMETER

[C#] 0x889800B6

[Visual Basic .NET] &H889800B6

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

[Visual Basic .NET]

Example

oMyProduct = myProductCatalog.GetProduct("SKU4005")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

ProductCatalog3 Class

ProductCatalog3.CreateProduct

ProductCatalog3.DeleteProduct

Copyright © 2005 Microsoft Corporation.
All rights reserved.