ProductCatalog3.DeleteProduct Method (PIA)
Use this method to delete a product from the Product Catalog System.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub DeleteProduct(varProductID As Object)
[C#]
using Microsoft.CommerceServer.Interop.Catalog;
…
public void DeleteProduct(object varProductID);
Parameters
[Visual Basic .NET]
- varProductID
An Object that contains the unique identifier of the product to be deleted.
[C#]
- varProductID
An object that contains the unique identifier of the product to be deleted.
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_CAT_VC_NOT_A_SUPPLIER_CATALOG | [C#] 0x889800F9 [Visual Basic .NET] &H889800F9 |
Invalid catalog type. This API can only be called on a base catalog. |
E_CAT_INVALIDVALUE_FOR_PRODUCTID | [C#] 0x8898004E [Visual Basic .NET] &H8898004E |
The value you specified for the ProductID is either out of range or does not satisfy the Min/Max condition. |
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_VC_INVALID_PROD_ID_OR_CATEGORY_NAME | [C#] 0x889800FB [Visual Basic .NET] &H889800FB |
The value you specified for the ProductID or CategoryName exceeds the maximum allowed length of 348 characters. |
E_CAT_INVALID_PARAMETER | [C#] 0x889800B6 [Visual Basic .NET] &H889800B6 |
The input parameter <parameter number> is invalid. |
E_CAT_PRODUCT_DOESNT_EXIST | [C#] 0x8898001E [Visual Basic .NET] &H8898001E |
The product you specified does not exist. |
Remarks
This method removes the product from the SQL Server database. The Product object caches information for improved performance. Because of this cache, the CatalogName and ProductID methods of the Product object will continue to return the old values after the DeleteProduct method has been called. The Variants, ParentCategories, AncestorCategories, RelatedCategories, and RelatedProducts properties will return an empty Recordset and no error message.
Caution
- Deleting a product with variants also deletes all of the variants.
[Visual Basic .NET]
Example
myProductCatalog.DeleteProduct(654321)
Requirements
Namespace: Microsoft.CommerceServer.Interop.Catalog
Platforms: Windows 2000, Windows Server 2003
Assembly: cataloglib (in cataloglib.dll)
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.