| |||||||||||
ConstraintCollection.CanRemove MethodSystem.Data Namespace ConstraintCollection Class Indicates if a Constraint can be removed. [ VB ] Public Function CanRemove ( _ ByVal constraint As Constraint _ ) As Boolean [ C# ] public bool CanRemove ( Constraint constraint ); [ C++ ] public: bool CanRemove ( Constraint* constraint ); [ JScript ] public function CanRemove ( constraint : Constraint ) : Boolean Parameters
Return ValueGenerates an exception if the Constraint can not be removed from collection. Otherwise, true if the Constraint can be removed. Exceptions
RemarksWhen a DataRelation is added to a DataSet, a ForeignKeyConstraint and UniqueConstraint are added automatically to the parent table and the child table. The UniqueConstraint is applied to the parent table's primary key column, and the ForeignKeyConstraint is applied to the child table's foreign key column. In that case, attempting to remove the UniqueConstraint will cause an exception to be thrown because the ForeignKeyConstraint must be removed first. To avoid this, use the CanRemove to determine if a UniqueConstraint can be removed. ExampleThe following example uses the CanRemove to determine if a Constraint can be removed, before attempting to remove it.
See Also |
| ||||||||||
Check out related books at Amazon
© 2000-2008 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 aspxtreme