asp.net.ph

ConstraintCollection.Remove Method ( String )

System.Data Namespace   ConstraintCollection Class


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

[ VB ]
Overloads Public Sub Remove ( _
   ByVal name As String _
)

[ C# ]
public void Remove (
   String name
);

[ C++ ]
public: void Remove (
   String* name
);

[ JScript ]
public function Remove (
   name : String
);

Parameters

name
The name of the Constraint to remove.

Remarks

Use the Contains method to determine if the collection contains the target Constraint.

Use the CanRemove method to determine if a Constraint can be removed.

The CollectionChanged event occurs if the removal succeeds.

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.

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   ConstraintCollection.Remove Overload List   CanRemove   Contains   IndexOf 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