System.Data Namespace ConstraintCollection Class
Returns the Constraint from the collection with the specified name.
Constraint variable = ConstraintCollection.Item [ name ];
... or ...
Constraint variable = ConstraintCollection [ name ];
dim variable as Constraint = ConstraintCollection.Item ( name )
... or ...
dim variable as Constraint = ConstraintCollection ( name )
variable : Constraint = ConstraintCollection.Item ( name );
... or ...
variable : Constraint = ConstraintCollection ( name ); |
|
C# |
VB |
JScript |
- name
- The ConstraintName of the constraint to return.
The Constraint with the specified name; otherwise a null value if the Constraint does not exist.
Use the Contains method to test for the existence of a specific constraint.
The following example gets the named Constraint.
private void GetConstraint ( DataTable myTable ) {
if ( myTable.Constraints.Contains ( "myOrdersConstraint" ) ) {
Constraint myConstraint = myTable.Constraints [ "myOrdersConstraint" ];
}
}
Private Sub GetConstraint ( myTable As DataTable )
If myTable.Constraints.Contains ( "myOrdersConstraint" ) Then
Dim myConstraint As Constraint = myTable.Constraints ( "myOrdersConstraint" )
End If
End Sub |
|
C# |
VB |
ConstraintCollection Members ConstraintCollection.Item Overload List