asp.net.ph

SqlParameterCollection.RemoveAt Method ( String )

System.Data.SqlClient Namespace   SqlParameterCollection Class


Removes the SqlParameter with the given name from the collection.

[ VB ]
Overloads Public Sub RemoveAt ( _
   ByVal parameterName As String _
)

[ C# ]
void RemoveAt (
   string parameterName
);

[ C++ ]
public: void RemoveAt (
   String* parameterName
);

[ JScript ]
public function RemoveAt (
   parameterName : String
);

Parameters

parameterName
the name of the parameter to retrieve.

Implements

IDataParameterCollection.RemoveAt

Exceptions


Exception Type Condition
ArgumentException The specified value does not exist.

Example

The following example first uses the Contains property to find an SqlParameter with a given ParameterName within the Parameters collection of a specifed SqlCommand object. If the parameter exists, the example removes it.

public void SearchSqlParams ( SqlCommand myCmd ) {
   SqlParameterCollection myParams = myCmd.Parameters;
   if ( myParams.Contains ( "@Description" ) )
      myCmd.Parameters.RemoveAt ( "@Description" );

}
  C# VB

See Also

SqlParameterCollection Members   SqlParameterCollection.RemoveAt Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph