Class DataColumnCollection
- Namespace
- Datafication.Core.Data
- Assembly
- Datafication.Core.dll
Represents a collection of DataColumn objects.
[Serializable]
[DataContract]
public class DataColumnCollection
- Inheritance
-
objectDataColumnCollection
Properties
Count
Gets the total number of columns in the collection.
public int Count { get; }
Property Value
- int
this[int]
Gets or sets the column at the specified index.
public DataColumn this[int index] { get; set; }
Parameters
indexintThe zero-based index of the column to get or set.
Property Value
- DataColumn
The DataColumn at the specified index.
this[string]
Gets the column with the specified name.
public DataColumn this[string columnName] { get; }
Parameters
columnNamestringThe name of the column to get.
Property Value
- DataColumn
The DataColumn with the specified name, or null if not found.
Methods
Add(DataColumn)
Adds a DataColumn to the collection.
public void Add(DataColumn column)
Parameters
columnDataColumnThe DataColumn to add.
Clear()
Removes all columns from the collection.
public void Clear()
Contains(string)
Determines whether the collection contains a column with the specified name.
public bool Contains(string columnName)
Parameters
columnNamestringThe name of the column to check for.
Returns
- bool
True if the collection contains a column with the specified name; otherwise, false.
Find(string)
Finds a column with the specified name.
public DataColumn Find(string columnName)
Parameters
columnNamestringThe name of the column to find.
Returns
- DataColumn
The DataColumn with the specified name, or null if not found.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<DataColumn> GetEnumerator()
Returns
- IEnumerator<DataColumn>
An enumerator for the collection.
IndexOf(string)
Gets the index of the column with the specified name.
public int IndexOf(string columnName)
Parameters
columnNamestringThe name of the column.
Returns
- int
The index of the column if found; otherwise, -1.
Insert(int, DataColumn)
Inserts a column at the specified index.
public void Insert(int index, DataColumn column)
Parameters
indexintThe zero-based index at which the column should be inserted.
columnDataColumnThe DataColumn to insert.
Remove(DataColumn)
Removes the specified column from the collection.
public void Remove(DataColumn column)
Parameters
columnDataColumnThe DataColumn to remove.
Exceptions
- ArgumentNullException
Thrown when the column parameter is null.
ToArray()
Converts the collection to an array.
public DataColumn[] ToArray()
Returns
- DataColumn[]
An array containing all columns in the collection.