System.Data Namespace Constraint Class
Sets or retrieves the name of a constraint.
Script |
Constraint.ConstraintName [ = strName ] |
The property is read/write with no default value.
The ConstraintCollection is returned by the Constraints property of the DataTable class.
The following example iterates through the ConstraintCollection of a DataTable and prints each ConstraintName.
private void getConstraintNames ( DataTable myTable ) {
foreach ( Constraint cs in myTable.Constraints ) {
Response.Write ( cs.ConstraintName );
}
}
Private Sub getConstraintNames ( myTable As DataTable )
Dim cs As Constraint
For Each cs In myTable.Constraints
Response.Write ( cs.ConstraintName )
Next cs
End Sub |
|
C# |
VB |
Constraint Members