>Append Method

Appends an object to a collection.

Syntax

collection.Append Object

The collection placeholder represents the collection to which you want to append an object. The Object placeholder is an object variable representing the object you wish to append.

Remarks

Use the Append method on a collection to add an object to that collection. This method is available only on the Parameters collection of a Command object. You must set the Name and Type properties of a Parameter object before appending it to the Parameters collection. If you select a numeric data type, you must also set the Precision property to a value greater than zero. If you select a variable-length data type, you must also set the Size property to a value greater than zero.

You can minimize calls to the provider to improve performance when using stored procedures or parameterized queries. However, you must know the names and properties of the parameters associated with the stored procedure or parameterized query you wish to call. Create Parameter objects with the appropriate property settings and use the Append method to add them to the Parameters collection. This lets you set and return parameter values without having to call the provider for the parameter information. If you are writing to a provider that does not supply parameter information, you must manually populate the Parameters collection using this method to be able to use parameters at all.