Export (0) Print
Expand All

OleDbParameterCollection.RemoveAt Method

Removes the specified OleDbParameter from the collection.

Overload List

Removes the OleDbParameter at the specified index from the collection.

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

Removes the OleDbParameter with the specified name from the collection.

[Visual Basic] Overloads Public Overridable Sub RemoveAt(String) Implements IDataParameterCollection.RemoveAt
[C#] public virtual void RemoveAt(string);
[C++] public: virtual void RemoveAt(String*);
[JScript] public function RemoveAt(String);

Example

[Visual Basic, C#, C++] The following example searches for an OleDbParameter with the specified ParameterName within an OleDbParameterCollection collection. If the parameter exists, it is removed. This example assumes that an OleDbParameterCollection collection has already been created.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of RemoveAt. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub SearchOleDbParams()
    ' ...
    ' create OleDbParameterCollection myParameters and OleDbParameter myNewParam
    ' ...
    If myParameters.Contains("Description") Then
        myParameters.RemoveAt("Description")
    End If
End Sub 'SearchOleDbParams

[C#] 
public void SearchOleDbParams() {
    // ...
    // create OleDbParameterCollection myParameters and OleDbParameter myNewParam
    // ...
    if (myParameters.Contains("Description"))
       myParameters.RemoveAt("Description");
 }

[C++] 
public:
void SearchOleDbParams() {
    // ...
    // create OleDbParameterCollection myParameters and OleDbParameter myNewParam
    // ...
    if (myParameters->Contains(S"Description"))
       myParameters->RemoveAt(S"Description");
 }

[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

OleDbParameterCollection Class | OleDbParameterCollection Members | System.Data.OleDb Namespace

Show:
© 2014 Microsoft