Export (0) Print
Expand All

OracleParameterCollection.Clear Method

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

Removes all items from the collection.

[Visual Basic]
Public Overridable Sub Clear() Implements IList.Clear
[C#]
public virtual void Clear();
[C++]
public: virtual void Clear();
[JScript]
public function Clear();

Implements

IList.Clear

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 clears the collection.

[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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

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

Show:
© 2014 Microsoft