asp.net.ph

ConstraintCollection.Remove Method

System.Data Namespace   ConstraintCollection Class


Removes a Constraint from the ConstraintCollection.

Overload List

1. Removes the specified Constraint from the collection.

2. Removes the constraint, specified by name, from the collection.


Example

The following example removes a Constraint from a ConstraintCollection after testing for its presence with the Contains method, and whether it can be removed with the CanRemove method.

NOTE: This example uses one of the overloaded versions of Remove. For other examples that may be available, see the individual overload topics.

private void RemoveConstraint ( ConstraintCollection myConstraints, 
      Constraint myConstraint ) {
   try {
      if ( myConstraints.Contains ( myConstraint.ConstraintName ) ) {
         if ( myConstraints.CanRemove ( myConstraint ) ) {
            myConstraints.Remove ( myConstraint.ConstraintName );
         }
      }
   }
   catch ( Exception myException ) {
      Response.Write ( myException.Message );
   }
}
  C# VB

See Also

ConstraintCollection Members 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