asp.net.ph

ConstraintCollection.Item Property ( Int32 )

System.Data Namespace   ConstraintCollection Class


Returns the Constraint from the collection at the specified index.

Syntax


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

Parameters

index
The index of the constraint to return.

Property Value

The Constraint at the specified index.

Exceptions


Exception Type Condition
IndexOutOfRangeException Occurs when the index value is greater than the number of items in the collection.

Remarks

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

Example

The following example gets each Constraint from the ConstraintCollection.

private void GetConstraint ( DataTable myTable ) {

   for ( int i = 0; i < myTable.Constraints.Count; i++ ) {
      Response.Write ( myTable.Constraints [ ].ConstraintName );
      Response.Write ( myTable.Constraints [ ].GetType ( ) );
   }
}
  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