DataRelationCollection DataRelationCollection DataRelationCollection DataRelationCollection Class

Definition

Represents the collection of DataRelation objects for this DataSet.

public ref class DataRelationCollection abstract : System::Data::InternalDataCollectionBase
public abstract class DataRelationCollection : System.Data.InternalDataCollectionBase
type DataRelationCollection = class
    inherit InternalDataCollectionBase
Public MustInherit Class DataRelationCollection
Inherits InternalDataCollectionBase
Inheritance
DataRelationCollectionDataRelationCollectionDataRelationCollectionDataRelationCollection

Remarks

A DataRelationCollection object enables navigation between related parent/child DataTable objects.

You create a DataRelationCollection object by defining it as a property of either the DataSet or the DataTable, instead of by directly using a constructor. (Use the Relations property of the DataSet, or the ParentRelations property of the DataTable.)

To access the collection, use the Relations property of the DataSet object.

As soon as the collection exists you can manage the objects it contains by using methods such as Add, Clear, and Remove.

Constructors

DataRelationCollection() DataRelationCollection() DataRelationCollection() DataRelationCollection()

Initializes a new instance of the DataRelationCollection class.

Properties

Count Count Count Count

Gets the total number of elements in a collection.

(Inherited from InternalDataCollectionBase)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value that indicates whether the InternalDataCollectionBase is read-only.

(Inherited from InternalDataCollectionBase)
IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Gets a value that indicates whether the InternalDataCollectionBase is synchonized.

(Inherited from InternalDataCollectionBase)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets the DataRelation object at the specified index.

Item[String] Item[String] Item[String] Item[String]

Gets the DataRelation object specified by name.

List List List List

Gets the items of the collection as a list.

(Inherited from InternalDataCollectionBase)
SyncRoot SyncRoot SyncRoot SyncRoot

Gets an object that can be used to synchronize the collection.

(Inherited from InternalDataCollectionBase)

Methods

Add(DataColumn, DataColumn) Add(DataColumn, DataColumn) Add(DataColumn, DataColumn) Add(DataColumn, DataColumn)

Creates a DataRelation with a specified parent and child column, and adds it to the collection.

Add(DataColumn[], DataColumn[]) Add(DataColumn[], DataColumn[]) Add(DataColumn[], DataColumn[]) Add(DataColumn[], DataColumn[])

Creates a DataRelation with the specified parent and child columns, and adds it to the collection.

Add(DataRelation) Add(DataRelation) Add(DataRelation) Add(DataRelation)

Adds a DataRelation to the DataRelationCollection.

Add(String, DataColumn, DataColumn) Add(String, DataColumn, DataColumn) Add(String, DataColumn, DataColumn) Add(String, DataColumn, DataColumn)

Creates a DataRelation with the specified name, and parent and child columns, and adds it to the collection.

Add(String, DataColumn, DataColumn, Boolean) Add(String, DataColumn, DataColumn, Boolean) Add(String, DataColumn, DataColumn, Boolean) Add(String, DataColumn, DataColumn, Boolean)

Creates a DataRelation with the specified name, parent and child columns, with optional constraints according to the value of the createConstraints parameter, and adds it to the collection.

Add(String, DataColumn[], DataColumn[]) Add(String, DataColumn[], DataColumn[]) Add(String, DataColumn[], DataColumn[]) Add(String, DataColumn[], DataColumn[])

Creates a DataRelation with the specified name and arrays of parent and child columns, and adds it to the collection.

Add(String, DataColumn[], DataColumn[], Boolean) Add(String, DataColumn[], DataColumn[], Boolean) Add(String, DataColumn[], DataColumn[], Boolean) Add(String, DataColumn[], DataColumn[], Boolean)

Creates a DataRelation with the specified name, arrays of parent and child columns, and value specifying whether to create a constraint, and adds it to the collection.

AddCore(DataRelation) AddCore(DataRelation) AddCore(DataRelation) AddCore(DataRelation)

Performs verification on the table.

AddRange(DataRelation[]) AddRange(DataRelation[]) AddRange(DataRelation[]) AddRange(DataRelation[])

Copies the elements of the specified DataRelation array to the end of the collection.

CanRemove(DataRelation) CanRemove(DataRelation) CanRemove(DataRelation) CanRemove(DataRelation)

Verifies whether the specified DataRelation can be removed from the collection.

Clear() Clear() Clear() Clear()

Clears the collection of any relations.

Contains(String) Contains(String) Contains(String) Contains(String)

Verifies whether a DataRelation with the specific name (case insensitive) exists in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Copies all the elements of the current InternalDataCollectionBase to a one-dimensional Array, starting at the specified InternalDataCollectionBase index.

(Inherited from InternalDataCollectionBase)
CopyTo(DataRelation[], Int32) CopyTo(DataRelation[], Int32) CopyTo(DataRelation[], Int32) CopyTo(DataRelation[], Int32)

Copies the collection of DataRelation objects starting at the specified index.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetDataSet() GetDataSet() GetDataSet() GetDataSet()

This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Gets an IEnumerator for the collection.

(Inherited from InternalDataCollectionBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IndexOf(DataRelation) IndexOf(DataRelation) IndexOf(DataRelation) IndexOf(DataRelation)

Gets the index of the specified DataRelation object.

IndexOf(String) IndexOf(String) IndexOf(String) IndexOf(String)

Gets the index of the DataRelation specified by name.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs)

Raises the CollectionChanged event.

OnCollectionChanging(CollectionChangeEventArgs) OnCollectionChanging(CollectionChangeEventArgs) OnCollectionChanging(CollectionChangeEventArgs) OnCollectionChanging(CollectionChangeEventArgs)

Raises the CollectionChanged event.

Remove(DataRelation) Remove(DataRelation) Remove(DataRelation) Remove(DataRelation)

Removes the specified relation from the collection.

Remove(String) Remove(String) Remove(String) Remove(String)

Removes the relation with the specified name from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Removes the relation at the specified index from the collection.

RemoveCore(DataRelation) RemoveCore(DataRelation) RemoveCore(DataRelation) RemoveCore(DataRelation)

Performs a verification on the specified DataRelation object.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Events

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

Occurs when the collection has changed.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to

Thread Safety

This type is safe for multithreaded read operations. You must synchronize any write operations.