OrderGroup.Initialize Method (PIA)

Use this method to initialize the OrderGroup object.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Orders
…
Public Sub Initialize(strConnectionString As String,
  strUserID As String)

[C#]

using Microsoft.CommerceServer.Interop.Orders;
…
public void Initialize(stringstrConnectionString,
  stringstrUserID,  objectlrucache);

Parameters

[Visual Basic .NET]

  • strConnectionString
    A String that contains the database connection string.
  • strUserID
    A String that specifies the user ID. All Commerce Server 2002 user ID values are GUIDs.

[C#]

  • strConnectionString
    A string that contains the database connection string.
  • strUserID
    A string that specifies the user ID. All Commerce Server 2002 user ID values are GUIDs.
  • lrucache
    An object specifying a Microsoft.CommerceServer.Interop.Caching.LRUCache object to use.

Exceptions

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

Remarks

Use this method to specify the connection string that the OrderGroup object uses for its database operations. You also specify a user_id that the object will use as an OrderGroup_id when performing basket operations. This same user_id value will be stored in the g_UserIDChangedBy field.

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

  • If you are loading an OrderGroup object on behalf of another user (for example as an administrator), you should specify the administrator user ID (or a placeholder user ID GUID that signifies administrative authority) so that g_UserIDChangedBy is updated with the appropriate value when the OrderGroup object is saved back to the database. If you wish to load an OrderGroup object with a Basket status in the role of an administrator, you must specify strUserID as the user ID of the user whose basket you wish to load. In this case g_UserIDChangedBy will not be updated with an administrator user ID.

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

[Visual Basic .NET]

Example

' oOrderGrp is a Commerce.OrderGroup Object
' sConnString is a valid connection string to the Commerce database
oOrderGrp.Initialize(sConnString, _
    "{D4F9C9CC-C33E-11D0-B8A0-00C04FB616C7}")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Orders

Platforms: Windows 2000, Windows Server 2003

Assembly: Microsoft.CommerceServer.Interop.Orders.Requisition.dll

See Also

OrderGroup Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.