System.Data Namespace ConstraintCollection Class
Returns the specified constraint from the collection.
1. Returns the Constraint with the specified name.
2. Returns the Constraint at the specified index.
The following example gets each Constraint from the ConstraintCollection.
NOTE: This example uses one of the overloaded versions of the Item property ( ConstraintCollection indexer ). For other examples that may be available, see the individual overload topics.
private void GetConstraint ( DataTable myTable ) {
for ( int i = 0; i < myTable.Constraints.Count; i++ ) {
Response.Write ( myTable.Constraints [ ].ConstraintName );
Response.Write ( myTable.Constraints [ ].GetType ( ) );
}
}
Private Sub GetConstraint ( myTable As DataTable )
Dim i As Integer
For i = 0 To myTable.Constraints.Count - 1
Response.Write ( myTable.Constraints ( i ).ConstraintName )
Response.Write ( myTable.Constraints ( i ).GetType ( ) )
Next i
End Sub |
|
C# |
VB |
ConstraintCollection Members