asp.net.ph

DataRelationCollection.Item Property ( Int32 )

System.Data Namespace   DataRelationCollection Class


Returns the DataRelation at the specified index in the collection.

Syntax


DataRelation variable = DataRelationCollection.Item [ index ];
... or ...
DataRelation variable = DataRelationCollection [ index ];
  C# VB JScript

Parameters

index
The zero-based index of the relation to return.

Property Value

The DataRelation 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

If the specified index does not exist, an exception is thrown.

Example

The following example uses the Item property to print the names of all DataRelation objects in the collection, each specified by index.

private void PrintRelationNamesByIndex ( DataSet ds ) {
    // get the DataRelationCollection from a DataSet.
   DataRelationCollection relations = ds.Relations;
   // print each relation's name using the index.
   for ( int i = 0; i < relations.Count; i++ ) {
      Response.Write ( relations [ ] );
   }
}
  C# VB

See Also

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