Export (0) Print
Expand All

OracleParameterCollection.Item Property (String)

Gets or sets the OracleParameter with the specified name.

Namespace: System.Data.OracleClient
Assembly: System.Data.OracleClient (in system.data.oracleclient.dll)

'Declaration
Public Default Property Item ( _
	parameterName As String _
) As OracleParameter
'Usage
Dim instance As OracleParameterCollection
Dim parameterName As String
Dim value As OracleParameter

value = instance(parameterName)

instance(parameterName) = value
/** @property */
public OracleParameter get_Item (String parameterName)

/** @property */
public void set_Item (String parameterName, OracleParameter value)

Not applicable.

Parameters

parameterName

The name of the parameter to retrieve.

Property Value

The OracleParameter with the specified name.

Exception typeCondition

IndexOutOfRangeException

The name specified does not exist.

The following example searches for an OracleParameter with a given ParameterName within an OracleParameterCollection. 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 an OracleParameterCollection has already been created.

Public Sub SearchOracleParams()
    ' ...
    ' create OracleParameterCollection parameters
    ' ...
    If Not parameters.Contains("DName") Then
        Console.WriteLine("ERROR: no such parameter in the collection")
    Else
        Console.WriteLine("Name: " & parameters("DName").ToString() & _
            "Index: " & parameters.IndexOf("DName").ToString())
    End If
End Sub 

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show:
© 2014 Microsoft