C# Класс System.Data.DataTableCollection

Наследование: InternalDataCollectionBase
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ArrayAdd void
AssignName string
BaseAdd void
BaseGroupSwitch void
BaseRemove void
CanRemove bool
Contains bool
Contains bool
DataTableCollection System.Diagnostics
FinishInitCollection void
GetTable DataTable
GetTableSmart DataTable
IndexOf int
InternalIndexOf int
InternalIndexOf int
MakeName string
OnCollectionChanged void
OnCollectionChanging void
RegisterName void
ReplaceFromInference void
UnregisterName void

Открытые методы

Метод Описание
Add ( ) : DataTable

Creates a new table with a default name and adds it to the collection.

Add ( string name ) : DataTable

Creates a table with the given name and adds it to the collection.

Add ( string name, string tableNamespace ) : DataTable
Add ( DataTable table ) : void

Adds the specified table to the collection.

AddRange ( DataTable tables ) : void
CanRemove ( DataTable table ) : bool

Verifies if a given table can be removed from the collection.

Clear ( ) : void

Clears the collection of any tables.

Contains ( string name ) : bool

Checks if a table, specified by name, exists in the collection.

Contains ( string name, string tableNamespace ) : bool
CopyTo ( DataTable array, int index ) : void
IndexOf ( DataTable table ) : int

Returns the index of a specified .

IndexOf ( string tableName ) : int

Returns the index of the table with the given name (case insensitive), or -1 if the table doesn't exist in the collection.

IndexOf ( string tableName, string tableNamespace ) : int
Remove ( DataTable table ) : void

Removes the specified table from the collection.

Remove ( string name ) : void

Removes the table with a specified name from the collection.

Remove ( string name, string tableNamespace ) : void
RemoveAt ( int index ) : void

Removes the table at the given index from the collection

this ( int index ) : DataTable

Gets the table specified by its index.

this ( string name ) : DataTable

Gets the table in the collection with the given name (not case-sensitive).

this ( string name, string tableNamespace ) : DataTable

Приватные методы

Метод Описание
ArrayAdd ( DataTable table ) : void
AssignName ( ) : string

Creates a new default name.

BaseAdd ( DataTable table ) : void

Does verification on the table and it's name, and points the table at the dataSet that owns this collection. An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown if this table already belongs to this collection, belongs to another collection. A DuplicateNameException is thrown if this collection already has a table with the same name (case insensitive).

BaseGroupSwitch ( DataTable oldArray, int oldLength, DataTable newArray, int newLength ) : void

BaseGroupSwitch will intelligently remove and add tables from the collection.

BaseRemove ( DataTable table ) : void

Does verification on the table and it's name, and clears the table's dataSet pointer. An ArgumentNullException is thrown if this table is null. An ArgumentException is thrown if this table doesn't belong to this collection or if this table is part of a relationship.

CanRemove ( DataTable table, bool fThrowException ) : bool
Contains ( string name, bool caseSensitive ) : bool
Contains ( string name, string tableNamespace, bool checkProperty, bool caseSensitive ) : bool
DataTableCollection ( DataSet dataSet ) : System.Diagnostics

DataTableCollection constructor. Used only by DataSet.

FinishInitCollection ( ) : void
GetTable ( string name, string ns ) : DataTable
GetTableSmart ( string name, string ns ) : DataTable
IndexOf ( string tableName, string tableNamespace, bool chekforNull ) : int
InternalIndexOf ( string tableName ) : int
InternalIndexOf ( string tableName, string tableNamespace ) : int
MakeName ( int index ) : string

Makes a default name with the given index. e.g. Table1, Table2, ... Tablei

OnCollectionChanged ( CollectionChangeEventArgs ccevent ) : void

Raises the event.

OnCollectionChanging ( CollectionChangeEventArgs ccevent ) : void
RegisterName ( string name, string tbNamespace ) : void

Registers this name as being used in the collection. Will throw an ArgumentException if the name is already being used. Called by Add, All property, and Table.TableName property. if the name is equivalent to the next default name to hand out, we increment our defaultNameIndex.

ReplaceFromInference ( List tableList ) : void
UnregisterName ( string name ) : void

Unregisters this name as no longer being used in the collection. Called by Remove, All property, and Table.TableName property. If the name is equivalent to the last proposed default name, we walk backwards to find the next proper default name to use.

Описание методов

Add() публичный Метод

Creates a new table with a default name and adds it to the collection.
public Add ( ) : DataTable
Результат DataTable

Add() публичный Метод

Creates a table with the given name and adds it to the collection.
public Add ( string name ) : DataTable
name string
Результат DataTable

Add() публичный Метод

public Add ( string name, string tableNamespace ) : DataTable
name string
tableNamespace string
Результат DataTable

Add() публичный Метод

Adds the specified table to the collection.
public Add ( DataTable table ) : void
table DataTable
Результат void

AddRange() публичный Метод

public AddRange ( DataTable tables ) : void
tables DataTable
Результат void

CanRemove() публичный Метод

Verifies if a given table can be removed from the collection.
public CanRemove ( DataTable table ) : bool
table DataTable
Результат bool

Clear() публичный Метод

Clears the collection of any tables.
public Clear ( ) : void
Результат void

Contains() публичный Метод

Checks if a table, specified by name, exists in the collection.
public Contains ( string name ) : bool
name string
Результат bool

Contains() публичный Метод

public Contains ( string name, string tableNamespace ) : bool
name string
tableNamespace string
Результат bool

CopyTo() публичный Метод

public CopyTo ( DataTable array, int index ) : void
array DataTable
index int
Результат void

IndexOf() публичный Метод

Returns the index of a specified .
public IndexOf ( DataTable table ) : int
table DataTable
Результат int

IndexOf() публичный Метод

Returns the index of the table with the given name (case insensitive), or -1 if the table doesn't exist in the collection.
public IndexOf ( string tableName ) : int
tableName string
Результат int

IndexOf() публичный Метод

public IndexOf ( string tableName, string tableNamespace ) : int
tableName string
tableNamespace string
Результат int

Remove() публичный Метод

Removes the specified table from the collection.
public Remove ( DataTable table ) : void
table DataTable
Результат void

Remove() публичный Метод

Removes the table with a specified name from the collection.
public Remove ( string name ) : void
name string
Результат void

Remove() публичный Метод

public Remove ( string name, string tableNamespace ) : void
name string
tableNamespace string
Результат void

RemoveAt() публичный Метод

Removes the table at the given index from the collection
public RemoveAt ( int index ) : void
index int
Результат void

this() публичный Метод

Gets the table specified by its index.
public this ( int index ) : DataTable
index int
Результат DataTable

this() публичный Метод

Gets the table in the collection with the given name (not case-sensitive).
public this ( string name ) : DataTable
name string
Результат DataTable

this() публичный Метод

public this ( string name, string tableNamespace ) : DataTable
name string
tableNamespace string
Результат DataTable