C# Class System.Data.DataTableCollection

Inheritance: InternalDataCollectionBase
Afficher le fichier Open project: dotnet/corefx Class Usage Examples

Private Properties

Свойство Type Description
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

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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.

Method Details

Add() public méthode

Creates a new table with a default name and adds it to the collection.
public Add ( ) : DataTable
Résultat DataTable

Add() public méthode

Creates a table with the given name and adds it to the collection.
public Add ( string name ) : DataTable
name string
Résultat DataTable

Add() public méthode

public Add ( string name, string tableNamespace ) : DataTable
name string
tableNamespace string
Résultat DataTable

Add() public méthode

Adds the specified table to the collection.
public Add ( DataTable table ) : void
table DataTable
Résultat void

AddRange() public méthode

public AddRange ( DataTable tables ) : void
tables DataTable
Résultat void

CanRemove() public méthode

Verifies if a given table can be removed from the collection.
public CanRemove ( DataTable table ) : bool
table DataTable
Résultat bool

Clear() public méthode

Clears the collection of any tables.
public Clear ( ) : void
Résultat void

Contains() public méthode

Checks if a table, specified by name, exists in the collection.
public Contains ( string name ) : bool
name string
Résultat bool

Contains() public méthode

public Contains ( string name, string tableNamespace ) : bool
name string
tableNamespace string
Résultat bool

CopyTo() public méthode

public CopyTo ( DataTable array, int index ) : void
array DataTable
index int
Résultat void

IndexOf() public méthode

Returns the index of a specified .
public IndexOf ( DataTable table ) : int
table DataTable
Résultat int

IndexOf() public méthode

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
Résultat int

IndexOf() public méthode

public IndexOf ( string tableName, string tableNamespace ) : int
tableName string
tableNamespace string
Résultat int

Remove() public méthode

Removes the specified table from the collection.
public Remove ( DataTable table ) : void
table DataTable
Résultat void

Remove() public méthode

Removes the table with a specified name from the collection.
public Remove ( string name ) : void
name string
Résultat void

Remove() public méthode

public Remove ( string name, string tableNamespace ) : void
name string
tableNamespace string
Résultat void

RemoveAt() public méthode

Removes the table at the given index from the collection
public RemoveAt ( int index ) : void
index int
Résultat void

this() public méthode

Gets the table specified by its index.
public this ( int index ) : DataTable
index int
Résultat DataTable

this() public méthode

Gets the table in the collection with the given name (not case-sensitive).
public this ( string name ) : DataTable
name string
Résultat DataTable

this() public méthode

public this ( string name, string tableNamespace ) : DataTable
name string
tableNamespace string
Résultat DataTable