C# Class System.Data.DataColumnCollection

Inheritance: InternalDataCollectionBase
显示文件 Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
AddAt void
AddColumnsImplementingIChangeTrackingList void
ArrayAdd void
ArrayAdd void
ArrayRemove void
AssignName string
BaseAdd void
BaseGroupSwitch void
BaseRemove void
CanRegisterName bool
CanRemove bool
CheckIChangeTracking void
Contains bool
DataColumnCollection System.Collections
EnsureAdditionalCapacity void
FinishInitCollection void
IndexOfCaseInsensitive int
MakeName string
MoveTo void
OnCollectionChanged void
OnCollectionChanging void
OnColumnPropertyChanged void
RegisterColumnName void
RemoveColumnsImplementingIChangeTrackingList void
UnregisterName void
this DataColumn

Public Methods

Method Description
Add ( ) : DataColumn

Creates and adds a to a columns collection.

Add ( string columnName ) : DataColumn

Creates and adds a with the specified name to the columns collection.

Add ( string columnName, Type type ) : DataColumn

Creates and adds a with the specified name and type to the columns collection.

Add ( string columnName, Type type, string expression ) : DataColumn

Creates and adds a with the specified name, type, and compute expression to the columns collection.

Add ( DataColumn column ) : void

Adds the specified to the columns collection.

AddRange ( DataColumn columns ) : void
CanRemove ( DataColumn column ) : bool

Checks if a given column can be removed from the collection.

Clear ( ) : void

Clears the collection of any columns.

Contains ( string name ) : bool

Checks whether the collection contains a column with the specified name.

CopyTo ( DataColumn array, int index ) : void
IndexOf ( DataColumn column ) : int

Returns the index of a specified .

IndexOf ( string columnName ) : int

Returns the index of a column specified by name.

Remove ( DataColumn column ) : void

Removes the specified from the collection.

Remove ( string name ) : void

Removes the column with the specified name from the collection.

RemoveAt ( int index ) : void

Removes the column at the specified index from the collection.

this ( int index ) : DataColumn

Gets the from the collection at the specified index.

this ( string name ) : DataColumn

Gets the from the collection with the specified name.

Private Methods

Method Description
AddAt ( int index, DataColumn column ) : void
AddColumnsImplementingIChangeTrackingList ( DataColumn dataColumn ) : void
ArrayAdd ( DataColumn column ) : void

Adds the column to the columns array.

ArrayAdd ( int index, DataColumn column ) : void
ArrayRemove ( DataColumn column ) : void
AssignName ( ) : string

Creates a new default name.

BaseAdd ( DataColumn column ) : void

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

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

BaseGroupSwitch will intelligently remove and add tables from the collection.

BaseRemove ( DataColumn column ) : void

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

CanRegisterName ( string name ) : bool
CanRemove ( DataColumn column, bool fThrowException ) : bool
CheckIChangeTracking ( DataColumn column ) : void
Contains ( string name, bool caseSensitive ) : bool
DataColumnCollection ( DataTable table ) : System.Collections

DataColumnCollection constructor. Used only by DataTable.

EnsureAdditionalCapacity ( int capacity ) : void
FinishInitCollection ( ) : void
IndexOfCaseInsensitive ( string name ) : int
MakeName ( int index ) : string

Makes a default name with the given index. e.g. Column1, Column2, ... Columni

MoveTo ( DataColumn column, int newPosition ) : void
OnCollectionChanged ( CollectionChangeEventArgs ccevent ) : void

Raises the event.

OnCollectionChanging ( CollectionChangeEventArgs ccevent ) : void
OnColumnPropertyChanged ( CollectionChangeEventArgs ccevent ) : void
RegisterColumnName ( string name, DataColumn column ) : 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 Column.ColumnName property. if the name is equivalent to the next default name to hand out, we increment our defaultNameIndex. NOTE: To add a child table, pass column as null

RemoveColumnsImplementingIChangeTrackingList ( DataColumn dataColumn ) : void
UnregisterName ( string name ) : void

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

this ( string name, string ns ) : DataColumn

Method Details

Add() public method

Creates and adds a to a columns collection.
public Add ( ) : DataColumn
return DataColumn

Add() public method

Creates and adds a with the specified name to the columns collection.
public Add ( string columnName ) : DataColumn
columnName string
return DataColumn

Add() public method

Creates and adds a with the specified name and type to the columns collection.
public Add ( string columnName, Type type ) : DataColumn
columnName string
type System.Type
return DataColumn

Add() public method

Creates and adds a with the specified name, type, and compute expression to the columns collection.
public Add ( string columnName, Type type, string expression ) : DataColumn
columnName string
type System.Type
expression string
return DataColumn

Add() public method

Adds the specified to the columns collection.
public Add ( DataColumn column ) : void
column DataColumn
return void

AddRange() public method

public AddRange ( DataColumn columns ) : void
columns DataColumn
return void

CanRemove() public method

Checks if a given column can be removed from the collection.
public CanRemove ( DataColumn column ) : bool
column DataColumn
return bool

Clear() public method

Clears the collection of any columns.
public Clear ( ) : void
return void

Contains() public method

Checks whether the collection contains a column with the specified name.
public Contains ( string name ) : bool
name string
return bool

CopyTo() public method

public CopyTo ( DataColumn array, int index ) : void
array DataColumn
index int
return void

IndexOf() public method

Returns the index of a specified .
public IndexOf ( DataColumn column ) : int
column DataColumn
return int

IndexOf() public method

Returns the index of a column specified by name.
public IndexOf ( string columnName ) : int
columnName string
return int

Remove() public method

Removes the specified from the collection.
public Remove ( DataColumn column ) : void
column DataColumn
return void

Remove() public method

Removes the column with the specified name from the collection.
public Remove ( string name ) : void
name string
return void

RemoveAt() public method

Removes the column at the specified index from the collection.
public RemoveAt ( int index ) : void
index int
return void

this() public method

Gets the from the collection at the specified index.
public this ( int index ) : DataColumn
index int
return DataColumn

this() public method

Gets the from the collection with the specified name.
public this ( string name ) : DataColumn
name string
return DataColumn