Share via


ContentListSchema.Add Method (PIA)

Use this method to add a new column to a schema for use by a ContentListFactory object and its associated ContentList objects.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Caching
…
Public Sub Add(sName As String,
 Type As ColumnTypeEnum,
 Flags As Integer)

[C#]

using Microsoft.CommerceServer.Interop.Caching;
…
public void Add(stringsName,
 ColumnTypeEnumType,
 intFlags);

Parameters

[Visual Basic .NET]

  • sName
    A String that contains a name for the new column.
  • Type
    A value from the ColumnTypeEnum enumeration. See the Remarks section for more details.
  • Flags
    An Integer that contains the bit mask column flag settings for the new column.

[C#]

  • sName
    A string that contains a name for the new column.
  • Type
    A value from the ColumnTypeEnum enumeration. See the Remarks section for more details.
  • Flags
    An int that contains the bit mask column flag settings for the new column.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Remarks

Once the Locked property has been set to True, subsequent calls to this method will fail. The ContentListFactory object will set the Locked property of its ContentListSchema object to True when one of the following conditions is met:

  • Rows of data are allocated in the factory by setting the Count property or calling the ConstructFromRecordset method.
  • The ContentListFactory object has been used to construct one or more ContentList objects using the CreateNewContentList method.

The following table shows the values of the ColumnTypeEnum enumeration, their associated names, and describes their use.

Name Value Description
CLCOL_I2 2 A 16-bit integer. This value corresponds to the VARTYPE value VT_I2.
CLCOL_I4 3 A 32-bit integer. This value corresponds to the VARTYPE value VT_I4.
CLCOL_R4 4 A single precision floating point number. This value corresponds to the VARTYPE value VT_R4.
CLCOL_R8 5 A double precision floating point number. This value corresponds to the VARTYPE value VT_R8.
CLCOL_CY 6 A 64-bit integer used to store a currency value. This value corresponds to the VARTYPE value VT_CY. Monetary values stored using this type are scaled by 10,000 (4 decimal places). For example, the value 86900 would correspond to a currency value of $8.69 in the US. This is also the same as the money datatype used by SQL7.
CLCOL_DATE 7 A double precision floating point number used to store a date/time value. This value corresponds to the VARTYPE value VT_DATE.
CLCOL_DISPATCH 9 A reference to an object that supports scripting/automation (inherits from IDispatch). This value corresponds to the VARTYPE value VT_DISPATCH.
CLCOL_BOOL 11 A boolean value. This value corresponds to the VARTYPE value VT_BOOL. Do not confuse this with the C++ type BOOL, which is 4 bytes.
CLCOL_UNKNOWN 13 A pointer to an IUnknown-based interface that, presumably, does not support scripting/automation (inherits from IUnknown). This value corresponds to the VARTYPE value VT_UNKNOWN.
CLCOL_STRING 14 A pointer to a string in the private heap maintained by every ContentListFactory object. There is no corresponding VARTYPE value.
CLCOL_VARIANTARRAY 15 A pointer to a SAFEARRAY. The corresponding variant type is VT_ARRAY or VT_VARIANT.

Ee799191.note(en-US,CS.20).gif Note

  • With the exception of CLCOL_STRING and CLCOL_VARIANTARRAY, these types are identical to the corresponding VARTYPE and share the same constant value. They may be used as a VARTYPE.

[Visual Basic .NET]

Example

'"Color" is the column name.
'CLCOL_STRING indicates the column is of type String.
'0 indicates that no flags are applied.

myContentListSchema.Add("Color", CLCOL_STRING, 0)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Caching

Platforms: Windows 2000, Windows Server 2003

Assembly: cachecomplib (in cachecomplib.dll)

See Also

ContentListSchema Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.