다음을 통해 공유


GetProduct Method (String, String)

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

Retrieves a Product object containing information about the product.

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

Syntax

'Declaration
Public Function GetProduct ( _
    catalogName As String, _
    productId As String _
) As Product
'Usage
Dim instance As CatalogContext
Dim catalogName As String
Dim productId As String
Dim returnValue As Product

returnValue = instance.GetProduct(catalogName, _
    productId)
public Product GetProduct(
    string catalogName,
    string productId
)
public:
Product^ GetProduct(
    String^ catalogName, 
    String^ productId
)
public function GetProduct(
    catalogName : String, 
    productId : String
) : Product

Parameters

  • catalogName
    Type: System..::.String
    The name of the catalog. May not be nullNothingnullptra null reference (Nothing in Visual Basic).
  • productId
    Type: System..::.String
    The product identifier of the product to return. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: Microsoft.CommerceServer.Catalog..::.Product
A Product object containing information about the product. The ActiveLanguage on the returned Product object will be set to the default language of the catalog.

Exceptions

Exception Condition
ArgumentNullException

The catalogName or productId is nullNothingnullptra null reference (Nothing in Visual Basic).

ValidationException

One of the input parameters is invalid.

EntityDoesNotExistException

The productId does not exist in the catalog.

NotAuthorizedException

The caller is not authorized to perform this operation.

Remarks

The returned Product object contains multilingual information in the language specified by the language. You can use the returned Product object to access and update information about the product. If you make any changes to the returned Product object you should call the Save method to save the changes to the catalog system.

The catalogName should:

  • Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.

  • Not exceed 85 characters.

  • Not contain the .,"[]'()# characters.

  • Exist in the catalog system.

The productId should:

  • Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.

  • Not exceed 343 characters.

  • Already exist in the catalog.

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

GetProduct Overload

Microsoft.CommerceServer.Catalog Namespace