ContentListFactory.ConstructFromRecordset Method (PIA)

Use this method to initialize a new ContentListFactory object, and create and initialize a new ContentListSchema object, from a Recordset object.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Caching
Imports ADODB26Lib     ‘ for _Recordset
…
Public Sub ConstructFromRecordset(Recordset As _Recordset,
 OptionalArrSkip As Object,
 OptionalSchemaAdd As Object)

[C#]

using Microsoft.CommerceServer.Interop.Caching;
using ADODB26Lib;                              //For _Recordset
…
public void ConstructFromRecordset(_RecordsetRecordset,
 object ArrSkip,
 objectSchemaAdd);

Parameters

[Visual Basic .NET]

  • Recordset
    A reference to an object that implements the _Recordset interface from which the ContentList object will be constructed.
  • ArrSkip
    An optional Object that is a SimpleList object. The SimpleList object contains the names of field(s) that exist in the Recordset object, but that should not have a column in the new ContentList object.
  • Add
    An optional reference to an Object that is a ContentListSchema object that contains information about additional columns or new flags for existing columns that should be accounted for when the new ContentList object is created. Refer to the Remarks section for additional information.

[C#]

  • Recordset
    A _Recordset interface to an ADO Recordset object from which the ContentList object will be constructed.
  • ArrSkip
    An object that is a SimpleList object. The SimpleList object contains the names of field(s) that exist in the Recordset object but that should not have a column in the new ContentList object. To omit this optional parameter, set to Type.Missing.
  • Add
    An IContentListSchema interface of a ContentListSchema object that contains information about additional columns or new flags for existing columns that should be accounted for when the new ContentList object is created. Refer to the Remarks section for additional information. To omit this optional parameter, set to Type.Missing.

Exceptions

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

Remarks

[Visual Basic .NET] The Skip and Add parameters are both optional.

[C#] Values for the Skip and Add parameters are both optional, but at least one parameter must be passed. Pass Type.Missing to omit processing these parameters.

Columns defined in the ContentListSchema object that do not exist in the Recordset object are added to the new schema for the ContentListFactory object. Schema columns defined in both the ContentListSchema object and in the Recordset object get their flag settings from the former object, overriding the default flag settings otherwise applied. Supplemental columns may be either shared or private. Data for any supplemental, shared columns should be initialized using the SetData method. Data for any supplemental, private columns cannot be provided until a corresponding ContentList object is created.

The ContentListFactory object attempts to access the RecordCount property of the RecordSet object to determine how many rows of data for which space should be allocated. Not all types of RecordSet objects support this. If the RecordCount property cannot be determined, the ContentListFactory object will grow the factory in chunks of 100 rows. For this reason, it is most efficient to pass a RecordSet object for which the RecordCount property is defined.

Column types are mapped from the Recordset object according to the following table.

ADO Type ContentList Type
adSmallInt, adUnsignedSmallInt CLCOL_I2
adInteger, adUnsignedInt, adError CLCOL_I4
adSingle CLCOL_I4
adDouble CLCOL_R8
adDBDate, adDBTime, adDBTimeStamp CLCOL_DATE
adChar, adVarChar, adLongVarChar, adWChar, adVarWChar, adLongVarWChar CLCOL_STRING
adChapter*, adDispatch CLCOL_DISPATCH
adChapter CLCOL_UNKNOWN
adBoolean CLCOL_BOOL

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

  • *One level of hierarchical Recordset objects are supported. The child Recordset objects are created in the ContentList object as a SimpleList of Dictionary objects.

[Visual Basic .NET]

Example

'rsSource is an existing recordset.
'vSkip is a simple list of fields to ignore.
'vSchema is a ContentListSchema object.
myContentListFactory.ConstructFromRecordset(rsSource, vSkip, vSchema)

See Also

ContentListFactory Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.