DataRelationCollection Класс
Определение
Представляет коллекцию объектов DataRelation для DataSet.Represents the collection of DataRelation objects for this DataSet.
public ref class DataRelationCollection abstract : System::Data::InternalDataCollectionBase
[System.Serializable]
public abstract class DataRelationCollection : System.Data.InternalDataCollectionBase
type DataRelationCollection = class
inherit InternalDataCollectionBase
Public MustInherit Class DataRelationCollection
Inherits InternalDataCollectionBase
- Наследование
- Атрибуты
Комментарии
Объект позволяет переходить между связанными родительскими DataTable и дочерними объектами. DataRelationCollectionA DataRelationCollection object enables navigation between related parent/child DataTable objects.
DataRelationCollection Объект создается путем определения его в качестве свойства DataSet либо DataTableлибо, либо вместо непосредственного использования конструктора.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. (Используйте Relations свойство DataSet ParentRelations объектаDataTableили свойства.)(Use the Relations property of the DataSet, or the ParentRelations property of the DataTable.)
Чтобы получить доступ к коллекции, используйте Relations свойство DataSet объекта.To access the collection, use the Relations property of the DataSet object.
Как только коллекция будет создана, можно управлять объектами, которые она содержит, с помощью таких методов Add, Clearкак, Removeи.As soon as the collection exists you can manage the objects it contains by using methods such as Add, Clear, and Remove.
Конструкторы
DataRelationCollection() |
Инициализирует новый экземпляр класса DataRelationCollection.Initializes a new instance of the DataRelationCollection class. |
Свойства
Count |
Возвращает общее число элементов в коллекции.Gets the total number of elements in a collection. (Унаследовано от InternalDataCollectionBase) |
IsReadOnly |
Возвращает значение, которое определяет, является ли коллекция InternalDataCollectionBase доступной только для чтения.Gets a value that indicates whether the InternalDataCollectionBase is read-only. (Унаследовано от InternalDataCollectionBase) |
IsSynchronized |
Возвращает значение, которое определяет, является ли коллекция InternalDataCollectionBase синхронизированной.Gets a value that indicates whether the InternalDataCollectionBase is synchronized. (Унаследовано от InternalDataCollectionBase) |
Item[Int32] |
Возвращает объект DataRelation по указанному индексу.Gets the DataRelation object at the specified index. |
Item[String] |
Получает объект DataRelation, указанный именем.Gets the DataRelation object specified by name. |
List |
Возвращает элементы коллекции в виде списка.Gets the items of the collection as a list. (Унаследовано от InternalDataCollectionBase) |
SyncRoot |
Возвращает объект, который можно использовать для синхронизации коллекции.Gets an object that can be used to synchronize the collection. (Унаследовано от InternalDataCollectionBase) |
Методы
Add(DataColumn, DataColumn) |
Создает DataRelation с указанными родительским и дочерним столбцами и добавляет их к коллекции.Creates a DataRelation with a specified parent and child column, and adds it to the collection. |
Add(DataColumn[], DataColumn[]) |
Создает DataRelation с указанными родительским и дочерним столбцами и добавляет их к коллекции.Creates a DataRelation with the specified parent and child columns, and adds it to the collection. |
Add(DataRelation) |
Добавляет объект DataRelation в коллекцию DataRelationCollection.Adds a DataRelation to the DataRelationCollection. |
Add(String, DataColumn, DataColumn) |
Создает отношение DataRelation с указанным именем и родительским и дочерним столбцами и добавляет их к коллекции.Creates a DataRelation with the specified name, and parent and child columns, and adds it to the collection. |
Add(String, DataColumn, DataColumn, Boolean) |
Создает отношение DataRelation с указанным именем, родительскими и дочерними столбцами, с необязательными ограничениями в соответствии со значением параметра |
Add(String, DataColumn[], DataColumn[]) |
Создает DataRelation с указанным именем и массивами родительских и дочерних столбцов и добавляет их к коллекции.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) |
Создает DataRelation с указанным именем, массивами родительских и дочерних столбцов и значение, указывающее, создавать ли ограничения, и добавляет их к коллекции.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) |
Выполняет проверку таблицы.Performs verification on the table. |
AddRange(DataRelation[]) |
Копирует элементы указанного массива DataRelation в конец коллекции.Copies the elements of the specified DataRelation array to the end of the collection. |
CanRemove(DataRelation) |
Проверяет, может ли быть удалено из коллекции указанное DataRelation.Verifies whether the specified DataRelation can be removed from the collection. |
Clear() |
Удаляет отношения из коллекции.Clears the collection of any relations. |
Contains(String) |
Проверяет, существует ли в коллекции DataRelation с указанным именем (без учета регистра).Verifies whether a DataRelation with the specific name (case insensitive) exists in the collection. |
CopyTo(Array, Int32) |
Копирует все элементы текущего объекта InternalDataCollectionBase в одномерный массив Array, начиная с указанного индекса InternalDataCollectionBase.Copies all the elements of the current InternalDataCollectionBase to a one-dimensional Array, starting at the specified InternalDataCollectionBase index. (Унаследовано от InternalDataCollectionBase) |
CopyTo(DataRelation[], Int32) |
Копирует коллекцию объектов DataRelation, начиная с указанного индекса.Copies the collection of DataRelation objects starting at the specified index. |
Equals(Object) |
Определяет, равен ли указанный объект текущему объекту.Determines whether the specified object is equal to the current object. (Унаследовано от Object) |
GetDataSet() |
Этот метод поддерживает инфраструктуру .NET Framework и не предназначен для использования непосредственно из программного кода.This method supports the .NET Framework infrastructure and is not intended to be used directly from your code. |
GetEnumerator() |
Возвращает объект IEnumerator для коллекции.Gets an IEnumerator for the collection. (Унаследовано от InternalDataCollectionBase) |
GetHashCode() |
Служит в качестве хэш-функции по умолчанию.Serves as the default hash function. (Унаследовано от Object) |
GetType() |
Возвращает объект Type для текущего экземпляра.Gets the Type of the current instance. (Унаследовано от Object) |
IndexOf(DataRelation) |
Возвращает индекс указанного объекта DataRelation.Gets the index of the specified DataRelation object. |
IndexOf(String) |
Получает индекс ограничения DataRelation, заданного по имени.Gets the index of the DataRelation specified by name. |
MemberwiseClone() |
Создает неполную копию текущего объекта Object.Creates a shallow copy of the current Object. (Унаследовано от Object) |
OnCollectionChanged(CollectionChangeEventArgs) |
Вызывает событие CollectionChanged.Raises the CollectionChanged event. |
OnCollectionChanging(CollectionChangeEventArgs) |
Вызывает событие CollectionChanged.Raises the CollectionChanged event. |
Remove(DataRelation) |
Удаляет указанное отношение из коллекции.Removes the specified relation from the collection. |
Remove(String) |
Отношение с указанным именем удаляется из коллекции.Removes the relation with the specified name from the collection. |
RemoveAt(Int32) |
Удаляет отношение с указанным индексом из коллекции.Removes the relation at the specified index from the collection. |
RemoveCore(DataRelation) |
Выполняет проверку указанного объекта DataRelation.Performs a verification on the specified DataRelation object. |
ToString() |
Возвращает строку, представляющую текущий объект.Returns a string that represents the current object. (Унаследовано от Object) |
События
CollectionChanged |
Происходит при изменении коллекции.Occurs when the collection has changed. |
Методы расширения
Cast<TResult>(IEnumerable) |
Приводит элементы объекта IEnumerable к заданному типу.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Выполняет фильтрацию элементов объекта IEnumerable по заданному типу.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Позволяет осуществлять параллельный запрос.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Преобразовывает коллекцию IEnumerable в объект IQueryable.Converts an IEnumerable to an IQueryable. |
Применяется к
Потокобезопасность
Этот тип является надежным для многопоточных операций чтения.This type is safe for multithreaded read operations. Необходимо синхронизировать любые операции записи.You must synchronize any write operations.