Share via


Insert Method

Inserts the specified Promocode string into the PromoCodeStringCollection at the specified location.

Namespace:  Microsoft.CommerceServer.Runtime.Orders
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Sub Insert ( _
    index As Integer, _
    promotionCode As String _
)
'Usage
Dim instance As PromoCodeStringCollection
Dim index As Integer
Dim promotionCode As String

instance.Insert(index, promotionCode)
public void Insert(
    int index,
    string promotionCode
)
public:
void Insert(
    int index, 
    String^ promotionCode
)
public function Insert(
    index : int, 
    promotionCode : String
)

Parameters

  • index
    Type: System..::.Int32
    The zero based index at which the Promocode string should be added.

Exceptions

Exception Condition
ArgumentNullException

The promotionCode is nullNothingnullptra null reference (Nothing in Visual Basic).

ArgumentException

The promotionCode contained only whitespace characters, or had zero length, or exceeded a maximum length of 50 characters.

EntityAlreadyExistsException

The promotionCode already exists in the collection.

Remarks

Use this method to insert a promo code string into the collection.

If index is equal to Count, the promo code string is added to the end of the Collection.

The indices of members of the collection with indices higher than index are each increased by one. Indices are zero based. The collection Count is incremented.

Successfully calling Insert updates LastModified.

Permissions

See Also

Reference

PromoCodeStringCollection Class

PromoCodeStringCollection Members

Microsoft.CommerceServer.Runtime.Orders Namespace