Export (0) Print
Expand All

OracleParameterCollection.Item Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets or sets the OracleParameter with a specified attribute.

[C#] In C#, this property is the indexer for the OracleParameterCollection class.

Overload List

Gets or sets the OracleParameter with the specified name.

[Visual Basic] Overloads Public Default Property Item(String) As OracleParameter
[C#] public OracleParameter this[string] {get; set;}
[C++] public: __property OracleParameter* get_Item(String*);
public: __property void set_Item(String*, OracleParameter*);
[JScript] OracleParameterCollection.Item (String)

Gets or sets the OracleParameter at the specified index.

[Visual Basic] Overloads Public Default Property Item(Integer) As OracleParameter
[C#] public OracleParameter this[int] {get; set;}
[C++] public: __property OracleParameter* get_Item(int);
public: __property void set_Item(int, OracleParameter*);
[JScript] OracleParameterCollection.Item (int)

Example

[Visual Basic, C#, C++] The following example creates an OracleParameterCollection, adds instances of OracleParameter to the collection, displays the names of its OracleParameter objects, and then clears the collection.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of the Item property (OracleParameterCollection indexer). For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub CreateOracleParamColl(myCommand As OracleCommand)
    Dim myParamCollection As OracleParameterCollection = myCommand.Parameters
    myParamCollection.Add("pDName", OracleType.Varchar)
    myParamCollection.Add("pLoc", OracleType.Varchar)
    Dim myParamNames As String = ""
    Dim i As Integer
    For i = 0 To myParamCollection.Count - 1
        myParamNames += myParamCollection(i).ToString() + ControlChars.Cr
    Next i
    MessageBox.Show(myParamNames)
    myParamCollection.Clear()
End Sub 'CreateOracleParamColl

[C#] 
public void CreateOracleParamColl(OracleCommand myCommand) {
    OracleParameterCollection myParamCollection = myCommand.Parameters;
    myParamCollection.Add("pDName", OracleType.VarChar);
    myParamCollection.Add("pLoc", OracleType.VarChar);
    string myParamNames = "";
    for (int i=0; i < myParamCollection.Count; i++)
       myParamNames += myParamCollection[i].ToString() + "\n";
    MessageBox.Show(myParamNames);
    myParamCollection.Clear();
 }

[C++] 
public:
void CreateOracleParamColl(OracleCommand* myCommand) {
    OracleParameterCollection* myParamCollection = myCommand->Parameters;
    myParamCollection->Add(S"pDName", OracleType::VarChar);
    myParamCollection->Add(S"pLoc", OracleType::VarChar);
    String* myParamNames = S"";
    for (int i=0; i < myParamCollection->Count; i++)
       myParamNames = String::Concat( myParamNames, myParamCollection->Item[i], S"\n" );
    MessageBox::Show(myParamNames);
    myParamCollection->Clear();
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

OracleParameterCollection Class | OracleParameterCollection Members | System.Data.OracleClient Namespace

Show:
© 2015 Microsoft