asp.net.ph

ConstraintCollection.Item Property ( String )

System.Data Namespace   ConstraintCollection Class


Returns the Constraint from the collection with the specified name.

Syntax


Constraint variable = ConstraintCollection.Item [ name ];
... or ...
Constraint variable = ConstraintCollection [ name ];
  C# VB JScript

Parameters

name
The ConstraintName of the constraint to return.

Property Value

The Constraint with the specified name; otherwise a null value if the Constraint does not exist.

Remarks

Use the Contains method to test for the existence of a specific constraint.

Example

The following example gets the named Constraint.

private void GetConstraint ( DataTable myTable ) {
   if ( myTable.Constraints.Contains ( "myOrdersConstraint" ) ) {
      Constraint myConstraint = myTable.Constraints [ "myOrdersConstraint" ];
   }
}
  C# VB

See Also

ConstraintCollection Members   ConstraintCollection.Item Overload List 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