DataColumnCollection
Leave feedback
On this page
Inheritance: java.lang.Object
All Implemented Interfaces: java.lang.Iterable
public class DataColumnCollection implements Iterable<DataColumn>
Represents a collection of DataColumn objects for a DataTable. See also: https://referencesource.microsoft.com/#system.data/System/Data/DataColumnCollection.cs.
| Method | Description |
|---|---|
| add(DataColumn column) | Adds the specified DataColumn to the columns collection. |
| add(String columnName) | Creates and adds a DataColumn with the specified name to the columns collection. |
| add(String columnName, Class type) | Creates and adds a DataColumn with the specified name and type to the columns collection. |
| add(String columnName, Class type, int columnMapping, boolean allowAutoIncrement, boolean allowDBNull) | Creates and adds a DataColumn with the specified name, type and specific values to the columns collection. |
| indexOf(String columnName) | Returns the index of a column specified by name. |
| indexOf(DataColumn column) | Gets the index of a column specified by DataColumn. |
| get(int index) | Gets the DataColumn from the collection at the specified index. |
| get(String columnName) | Gets the DataColumn from the collection with the specified name. |
| contains(String name) | Checks whether the collection contains a column with the specified name. |
| remove(String name) | Removes the DataColumn object that has the specified name from the collection. |
| remove(DataColumn column) | Removes the DataColumn object that has the specified name from the collection. |
| getCount() | |
| iterator() | |
| clear() | Clears the collection of any columns. |
public void add(DataColumn column)
Adds the specified DataColumn to the columns collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| column | DataColumn | new column to add |
public void add(String columnName)
Creates and adds a DataColumn with the specified name to the columns collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnName | java.lang.String | new column |
public DataColumn add(String columnName, Class type)
Creates and adds a DataColumn with the specified name and type to the columns collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnName | java.lang.String | name |
| type | java.lang.Class | data type |
Returns: DataColumn - created a DataColumn instance.
add(String columnName, Class type, int columnMapping, boolean allowAutoIncrement, boolean allowDBNull)
public DataColumn add(String columnName, Class type, int columnMapping, boolean allowAutoIncrement, boolean allowDBNull)
Creates and adds a DataColumn with the specified name, type and specific values to the columns collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnName | java.lang.String | name |
| type | java.lang.Class | data type |
| columnMapping | int | column mapping type |
| allowAutoIncrement | boolean | is auto increment allowed |
| allowDBNull | boolean | is DBNull value allowed |
Returns: DataColumn - created a DataColumn instance.
public int indexOf(String columnName)
Returns the index of a column specified by name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnName | java.lang.String | the name of column |
Returns: int - the index of a column specified by name
public int indexOf(DataColumn column)
Gets the index of a column specified by DataColumn.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| column | DataColumn | DataColumn to find position for |
Returns: int - the index of a specified DataColumn.
public DataColumn get(int index)
Gets the DataColumn from the collection at the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | index of this column at this collection |
Returns: DataColumn - column with the specified name
public DataColumn get(String columnName)
Gets the DataColumn from the collection with the specified name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| columnName | java.lang.String | name of the column |
Returns: DataColumn - column with the specified name
public boolean contains(String name)
Checks whether the collection contains a column with the specified name.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | column name |
Returns: boolean - true if column with the specified name exists
public void remove(String name)
Removes the DataColumn object that has the specified name from the collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | java.lang.String | name of the column |
public void remove(DataColumn column)
Removes the DataColumn object that has the specified name from the collection.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| column | DataColumn | name of the column |
public int getCount()
Returns: int - the total number of elements in a collection.
public Iterator<DataColumn> iterator()
Returns: java.util.Iterator<com.groupdocs.assembly.system.data.DataColumn>
public void clear()
Clears the collection of any columns.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.