ListManager.CreateFromSegment Method (PIA)

Use this method to create a list from a Predictor resource segment.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Targeting
…
Public Function CreateFromSegment(listName As String,
  listDesc As String,
  lFlags As Integer,
  userFlags As Integer,
  modelName As String,
  segmentName As String,
  predHostName As String,
  DWConnStr As String,
  fpMinProbability As Double,
  bAsync As Integer,
  Optional ByRef pvarOpID As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop.Targeting;
…
public object CreateFromSegment(stringlistName,
  stringlistDesc,
  intlFlags,
  intuserFlags,
  stringmodelName,
  stringsegmentName,
  stringpredHostName,
  stringDWConnStr,
  doublefpMinProbability,
  int bAsync,
  ref objectpvarOpID);

Parameters

[Visual Basic .NET]

  • listName
    A String that contains provides the name for the list.
  • listDesc
    A String that contains the list description.
  • lFlags
    An Integer that specifies the bitmask flags that control the type of list created.
  • userFlags
    An Integer that contains application-specific user flags. Not used by the ListManager object.
  • modelName
    A String that contains the name of the Predictor segment model to use.
  • segmentName
    A String that contains the name of the segment to import.
  • predHostName
    A String that contains the name of the Predictor host server.
  • DWConnStr
    A String that contains the Data Warehouse connection string.
  • fpMinProbability
    A Double that contains the minimum probability associated with a given segment member for that member to be included in the list.
  • bAsync
    An Integer that specifies whether the creation operation is performed synchronously or asynchronously. A value of 1 indicates asynchronous processing.
  • pvarOpID
    An optional Object used to return an Operation ID.

[C#]

  • listName
    A string that provides the name for the list.
  • listDesc
    A string that contains the list description.
  • lFlags
    An int that specifies the bitmask flags that control the type of list created.
  • userFlags
    An int that contains application-specific user flags. Not used by the ListManager object.
  • modelName
    A string that contains the name of the Predictor segment model to use.
  • segmentName
    A string that contains the name of the segment to import.
  • predHostName
    A string that contains the name of the Predictor host server.
  • DWConnStr
    A string that contains the Data Warehouse connection string.
  • fpMinProbability
    A double that contains the minimum probability associated with a given segment member for that member to be included in the list.
  • bAsync
    An int that specifies whether the creation operation is performed synchronously or asynchronously. A value of 1 indicates asynchronous processing.
  • pvarOpID
    A reference to an object used to return an Operation ID.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an Object used to return the new list ID.

[C#] This method returns a reference to an object used to return the new list ID.

Exceptions

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

[Visual Basic .NET]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
&H8C400001 Failed to establish database connection.
&H8C400017 Unable to create the object.
&H8C400005 Invalid flags value.
&H8C400007 The specified list has already been created.
&H8C40000D The list is designated as a Mailable list but does not contain an rcp_email column.
&H8C40000B The operation was canceled.
&H8C400003 Error while executing SQL/ADO operation.
&H8C40000E The list is designated as a User list but does not contain an rcp_guid column.
&H80040007 The ListManager object has not been properly initialized.

[C#]

The following table shows the custom COM errors that a COMException can wrap.

Value Description
0x8C400001 Failed to establish database connection.
0x8C400017 Unable to create the object.
0x8C400005 Invalid flags value.
0x8C400007 The specified list has already been created.
0x8C40000D The list is designated as a Mailable list but does not contain an rcp_email column.
0x8C40000B The operation was canceled.
0x8C400003 Error while executing SQL/ADO operation.
0x8C40000E The list is designated as a User list but does not contain an rcp_guid column.
0x80040007 The ListManager object has not been properly initialized.

Remarks

This method calls into the PredictorServiceSiteAdmin object, passing it the modelName, segmentName, and fpMinProbability parameters along with a connection string to the database used by the ListManager object, and the table name that it should create.

For a list of possible values for the lflags parameter, see the GetListFlags method.

[Visual Basic .NET]

Example

' oListID is an Object
oListID = oListManager.CreateFromSegment("TequillaBuyers", _
 "Thirty year old tequilla buyers ", 20, 0, "Tequilla", "Thirty", _
 "TequillaServer", "Provider=SQLOLEDB;Data Source=servername;" & _
 "Initial Catalog=Retail_dw;Integrated Security='SSPI';", 0)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Targeting

Platforms: Windows 2000, Windows Server 2003

Assembly: listmanagerlib (in listmanagerlib.dll)

See Also

ListManager Class

ListManager.GetListFlags

Copyright © 2005 Microsoft Corporation.
All rights reserved.