CatalogManager3.AddPropertyAttribute Method (PIA)

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

Definition

[Visual Basic .NET]

Public Sub AddPropertyAttribute Method(strAttributeName As String,
  eDataType  As CatalogDataTypeEnum,Optional varMaxLength As Object,)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public void AddPropertyAttribute (stringstrAttributeName,
  CatalogTypeEnumeDataType,Object varMaxLength,);

Parameters

[Visual Basic .NET]

  • strAttributeName
    A String that contains the attribute name. See the Remarks section for a list of restricted characters.
  • eDataType
    An enumeration that contains the data type. See the Remarks section for valid values.
  • varMaxLength
    A VARIANT that contains the maximum string length if the eDataType parameter is cscString. This parameter is required if the eDataType parameter is cscString.

[C#]

  • strAttributeName
    A String that contains the attribute name. See the Remarks section for a list of restricted characters.
  • eDataType
    An enumeration that contains the data type. See the Remarks section for valid values.
  • varMaxLength
    A VARIANT that contains the maximum string length if the eDataType parameter is cscString. This parameter is required if the eDataType parameter is cscString.

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_ATTRIBUTE

[C#] 0x8898011

[Visual Basic .NET] &H8898017

The attribute name you specified is invalid. Attribute names cannot be blank and cannot exceed 36 characters. Attribute names cannot begin with a digit and cannot contain one of the following five reserved characters .,"[]
E_CAT_INVALID_DATATYPE

[C#] 0x8898007

[Visual Basic .NET] &H8898004

The datatype you specified is invalid.
E_CAT_INVALID_PARAMETER

[C#] 0x889800B

[Visual Basic .NET] &H8898006

The input parameter <parameter number> is invalid.
E_CAT_INVALID_COLUMN_LENGTH

[C#] 0x8898004

[Visual Basic .NET] &H8898000

The length specified for this property is not between 1 and 4000.
E_CAT_INVALID_DATATYPE_FOR_ATTRIBUTE

[C#] 0x889800A

[Visual Basic .NET] &H8898006

The enumeration or filename data types cannot be used for creating property attributes.
E_CAT_INBUILT_PROPERTY

[C#] 0x8898003

[Visual Basic .NET] &H889800E

The property name you specified is used as a Catalog Management Inbuilt property name.
E_CAT_BUILTIN_ATTRIBUTE

[C#] 0x889800A

[Visual Basic .NET] &H8898007

The property attribute that you specified is a built-in attribute and hence cannot be added or removed from the Product Catalog System.
E_CAT_INVALID_DATATYPE

[C#] 0x8898007

[Visual Basic .NET] &H8898004

The datatype you specified 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_MAX_ATTRIBUTES

[C#] 0x8898011

[Visual Basic .NET] &H8898018

You have exceeded the maximum limit of 100 attributes that can be created.
E_CAT_ATTRIBUTE_EXISTS

[C#] 0x8898010

[Visual Basic .NET] &H889801F

The property Attribute that you specified already exists.

Remarks

The varMaxLength parameter applies only when the eDataType parameter equals cscString. The minimum value is 1 and the maximum value is 4000. The varMaxLength parameter is ignored for all other data types.

Each catalog is limited to 100 attributes.

Property attribute names, and therefore the *strAttrName*****parameter, are limited to a maximum length of 35 characters, and cannot contain any of the following characters:

  • Period (.)
  • Comma (,)
  • Double quote (")
  • Left square bracket ([)
  • Right square bracket (])

The following table shows the values of the CatalogDataTypeEnum enumeration that are valid for this method, and shows their associated names, and describes their use.

Name Value Description
CscInteger 0 Indicates an exact numeric value that holds whole numbers from –2[31] (-2,147,483,648) <= n <= 2[31] –1 (2,147,483,647).
CscBigInteger 1 Indicates an exact numeric value with precision 19 (if signed) or 20 (if unsigned), and scale 0 (signed: –2[63] <= n <= 2[63] – 1, unsigned: 0 <= n <= 2[64] – 1) [3], [9].
CscFloat 2 Indicates a positive or negative floating-point number. The range of positive values is approximately 2.23E –308 through 1.79E 308, and the range of negative values is approximately –2.23E –308 through –1.79E 308.
CscDouble 3 Indicates a positive or negative floating-point number. The range of positive values is approximately 2.23E –308 through 1.79E 308, and the range of negative values is approximately –2.23E –308 through –1.79E 308.
CscBoolean 4 Indicates a Boolean (bit), holds either a 1 or 0. Integer values other than 1 or 0 are accepted but are always interpreted as 1.
CscString 5 Indicates a variable-length character string with a maximum string length of 4000 characters.
CscDateTime 6 Indicates a Microsoft SQL Server DateTime data type.
CscCurrency 7 Indicates a Microsoft SQL Server Money data type.
CscText 10 Indicates a Microsoft SQL Server Text data type.
CscInvalid -1 Reserved for future use.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.