dotConnect for DB2 Documentation
Devart.Data.DB2 Namespace / DB2ParameterCollection Class / Item Property / Item(String) Property
The name of the parameter to retrieve.
Example

Item(String) Property
Gets or sets the DB2Parameter with the specified name.
Syntax
'Declaration
 
Public Overloads Shadows Property Item( _
   ByVal parameterName As String _
) As DB2Parameter
 

Parameters

parameterName
The name of the parameter to retrieve.

Property Value

The DB2Parameter with the specified name.
Example
The following example searches for a DB2Parameter with a given ParameterName within a DB2ParameterCollection. If the parameter exists, the example displays the name and index of the parameter. If the parameter does not exist, the example displays an error. This example assumes that a DB2ParameterCollection has already been created.
public void SearchDB2Params() {
  // ...
  // create DB2ParameterCollection myParameters
  // ...
  if (!myParameters.Contains("DName"))
    MessageBox.Show("ERROR: no such parameter in the collection");
  else
    MessageBox.Show("Name: " + myParameters["DName"].ToString() +
      "Index: " + myParameters.IndexOf("DName").ToString());
}
Public Sub SearchDB2Params()
  ' ...
  ' create DB2ParameterCollection myParameters
  ' ...
  If Not myParameters.Contains("DName") Then
    MessageBox.Show("ERROR: no such parameter in the collection")
  Else
    MessageBox.Show("Name: "  & myParameters("DName").ToString()  & _
      "Index: "  & myParameters.IndexOf("DName").ToString())
  End If
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also