Share via


GenID.InitializeCounter Method (PIA)

Use this method to create or reset a global, sequential counter.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Orders
…
Public Sub InitializeCounter(bstrCounterName As String,
  dwInitialValue As Integer)

[C#]

using Microsoft.CommerceServer.Interop.Orders;
…
public void InitializeCounter(stringbstrCounterName,
  intdwInitialValue);

Parameters

[Visual Basic .NET]

  • bstrCounterName
    A String that contains the counter name.
  • dwInitialValue
    An Integer that contains the initial value of the counter.

[C#]

  • bstrCounterName
    A string that contains the counter name.
  • dwInitialValue
    An int that contains the initial value of the counter.

Exceptions

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

Remarks

Any number of counters may be created. If the counter already exists, its value is reset to the specified initial value.

A global counter will work across multiple computers.

The Initialize method must be called before calling the InitializeCounter method.

[Visual Basic .NET]

Example

' oGenID``is a Commerce GenID object

oGenID.InitializeCounter("OrderCounter", 213)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Orders

Platforms: Windows 2000, Windows Server 2003

Assembly: genidlib (in genidlib.dll)

See Also

GenID Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.