CatalogManager3.AddPropertyValue Method (PIA)

Use this method to add a value to the list of defined values for the specified enumeration.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub AddPropertyValue(strPropertyName As String,
  strLegalValue As StringstrLang As String)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public void AddPropertyValue(stringstrPropertyName,
  stringstrLegalValuestringstrLang);

Parameters

[Visual Basic .NET]

  • strPropertyName
    A String that contains the name of the enumeration property for which a new value will be defined.
  • strLegalValue
    A String that contains the new value.
  • strLang
    A String that contains the new value.

[C#]

  • strPropertyName
    A string that contains the name of the enumeration property for which a new value will be defined.
  • strLegalValue
    A string that contains the language identifier.
  • strLang
    A string that contains the language identifier.

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 a COMException can wrap.

Name Value Description
E_CAT_CATMGR_NOT_INITIALIZED

[C#] 0x889800B

[Visual Basic .NET] &H8898005

The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method
E_CAT_INVALID_PARAMETER

[C#] 0x889800B

[Visual Basic .NET] &H8898006

The input parameter <parameter number> is invalid.
E_CAT_INVALID_PROPERTY_NAME

[C#] 0x889800A

[Visual Basic .NET] &H8898002

The property name you specified is invalid. Property names cannot be blank and cannot exceed 100 characters. Property names cannot begin with a digit and cannot contain one of the following five reserved characters .,"[]
E_CAT_INVALID_ENUMERATED_VALUE

[C#] 0x889800E

[Visual Basic .NET] &H8898009

The value you specified for the enumerated property exceeds 128 characters
E_CAT_INVALID_LANGUAGE

[C#] 0x8898009

[Visual Basic .NET] &H889800E

The value you specified for the Language parameter is either empty or exceeds the maximum length of 10 characters
E_CAT_PROP_DOESNT_EXIST

[C#] 0x8898000

[Visual Basic .NET] &H8898005

The property name you specified does not exist.
E_CAT_PROP_NOT_ENUM

[C#] 0x8898000

[Visual Basic .NET] &H8898007

The property you specified is not a cscEnumeration data-type. This operation can only be performed on cscEnumeration data types.
E_CAT_VALUE_ALREADY_ADDED

[C#] 0x8898000

[Visual Basic .NET] &H8898008

The enumerated value you specified is already present in the list for this property.

Remarks

The AddPropertyValue method is used only for properties whose data type is cscEnumeration.

This method adds a new value to the list of defined values for an enumeration property. Any attempts by a client to set this property to a value other than one of the legal values will result in an error. This method is useful for automatic validation against properties that only have a small, fixed set of values. For example, a Color property may have red, green, and blue as the only defined values.

[Visual Basic .NET]

Example

myCatalogManager.AddPropertyValue("color", "Blue","en-US")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

CatalogManager3.GetPropertyValues

CatalogManager3.RemovePropertyValue

Table of Language Culture Names, Codes, and ISO Values

Copyright © 2005 Microsoft Corporation.
All rights reserved.