Export (0) Print
Expand All

OracleParameterCollection.CopyTo Method

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

Copies OracleParameter objects from the OracleParameterCollection to the specified array.

[Visual Basic]
Public Overridable Sub CopyTo( _
   ByVal array As Array, _
   ByVal index As Integer _
) Implements ICollection.CopyTo
[C#]
public virtual void CopyTo(
 Array array,
 int index
);
[C++]
public: virtual void CopyTo(
 Array* array,
 int index
);
[JScript]
public function CopyTo(
   array : Array,
 index : int
);

Parameters

array
The array into which to copy the OracleParameter objects.
index
The starting index of the array.

Implements

ICollection.CopyTo

Example

[Visual Basic, C#, C++] The following example exports the OracleParameterCollection to an array of OracleParameter objects, and returns the collection. It then clears the collection, and returns true. This example assumes that an OracleParameterCollection has already been created.

[Visual Basic] 
Public Function DoubleYourParams() As Boolean
    ' ...
    ' create OracleParameterCollection myParameters
    ' ...
    Dim myParamArray(2 * myParameters.Count) As OracleParameter
    myParameters.CopyTo(myParamArray, 0)
    myParameters.CopyTo(myParamArray, myParameters.Count)
    myParameters.Clear()
    Return True
End Function 'DoubleYourParams

[C#] 
public bool DoubleYourParams() 
 {
    // ...
    // create OracleParameterCollection myParameters
    // ...
    OracleParameter[] myParamArray = new OracleParameter[2*myParameters.Count];
    myParameters.CopyTo(myParamArray, 0);
    myParameters.CopyTo(myParamArray, myParameters.Count);
    myParameters.Clear();
    return true;
 }

[C++] 
public:
bool DoubleYourParams() 
 {
    // ...
    // create OracleParameterCollection myParameters
    // ...
    OracleParameter* myParamArray[] = new OracleParameter*[2*myParameters->Count];
    myParameters->CopyTo(myParamArray, 0);
    myParameters->CopyTo(myParamArray, myParameters->Count);
    myParameters->Clear();
    return true;
 }

[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:
© 2015 Microsoft