Pivotal.Data.GemFireXD.GFXDParameterCollection

Pivotal.Data.GemFireXD.GFXDParameterCollection encapsulates a collection of parameters to a GFXDCommand.

The parameter can be an instance of GFXDParameter or can directly be the .NET object itself. This class implements ADO.NET's System.Data.IDataParameterCollection and extends System.Data.Common.DbParameterCollection class.

It is not possible to create an instance of this class directly. Applications must use the Parameters property of the GFXDCommand to be executed for obtaining an instance of this and for adding parameters to it (either GFXDParameters or the values directly).

When the parameter added to the collection is not a GFXDParameter but is rather the raw .NET value, the ParameterDirection of the parameter is always assumed to be Input and the GFXDType of the parameter is determined from the .NET class of the object. If no class can be automatically determined then the type is set to a generic Other type and it is up to the server to determine whether the parameter can be converted to the actual expected type for the column or expression.

The methods and properties provided in addition to those of DbParameterCollection are as follows.
Method or property name Description
Add(string parameterName, GFXDType type) Adds a new parameter with given name and type to the collection and returns the created GFXDParameter.
Add(string parameterName, GFXDType type, object val) Adds a new parameter with given name, type, and value to the collection and returns the created GFXDParameter.
Contains(GFXDParameter parameter) Returns true if the collection contains the given parameter using the name of parameter if non-null. Otherwise, searches for the parameter by reference in the list.
Get(int index) Gets the parameter at given index in this collection. The returned value is whatever was added to the collection before, and can be either a GFXDParameter or the raw value of the parameter. This has the same result as when using the index ([]) operator.
GetNamedParameters() Gets the set of all named GFXDParameters in this collection.
Insert(int index, GFXDParameter parameter) Inserts the given parameter at the specified index in this collection.
Set(int index, object val) Sets the parameter at given index in this collection. The passed object can be an instance of GFXDParameter encapsulating the actual value to be bound, or directly the .NET value itself. This has the same result as when using the index ([]) operator.
SetParameter(string parameterName, GFXDParameter parameter) Adds a new named GFXDParameter to the collection. If the name passed is null, the parameter is added as a positional parameter that is bound to the CommandText of GFXDCommand by its position in the list. This has the same result as when using the index ([]) operator.
SetParameter(int index, GFXDParameter parameter) Adds a new GFXDParameter to the collection at given index. If the name of the parameter is null, the parameter is added as a positional parameter that is bound to the CommandText of GFXDCommand by its position in the list alone. This has the same result as when using the index ([]) operator.

For examples of usage, see the sections on named and positional parameters under Pivotal.Data.GemFireXD.GFXDCommand.

The MSDN documentation for IDataParameterCollection and DbParameterCollection provides more details about the API methods and usage.