VMware.Data.SQLFire.SQLFParameterCollection

VMware.Data.SQLFire.SQLFParameterCollection encapsulates a collection of parameters to a SQLFCommand.

The parameter can be an instance of SQLFParameter 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 SQLFCommand to be executed for obtaining an instance of this and for adding parameters to it (either SQLFParameters or the values directly).

When the parameter added to the collection is not a SQLFParameter but is rather the raw .NET value, the ParameterDirection of the parameter is always assumed to be Input and the SQLFType 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, SQLFType type) Adds a new parameter with given name and type to the collection and returns the created SQLFParameter.
Add(string parameterName, SQLFType type, object val) Adds a new parameter with given name, type, and value to the collection and returns the created SQLFParameter.
Contains(SQLFParameter 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 SQLFParameter 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 SQLFParameters in this collection.
Insert(int index, SQLFParameter 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 SQLFParameter 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, SQLFParameter parameter) Adds a new named SQLFParameter to the collection. If the name passed is null, the parameter is added as a positional parameter that is bound to the CommandText of SQLFCommand by its position in the list. This has the same result as when using the index ([]) operator.
SetParameter(int index, SQLFParameter parameter) Adds a new SQLFParameter 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 SQLFCommand 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 VMware.Data.SQLFire.SQLFCommand.

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