DataTableCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class DataTableCollection implements Iterable

Represents the collection of tables for the DataSet.

Methods

MethodDescription
add(System.Data.DataTable table)Adds the specified DataTable to the collection.
add(String name)Creates a DataTable object by using the specified name and adds it to the collection.
contains(String name)Gets a value that indicates whether a DataTable object with the specified name exists in the collection.
get(int index)Gets the DataTable object at the specified index.
get(String name)Gets the DataTable object with the specified name.
get(String name, String tableNamespace)Gets the DataTable object with the specified name in the specified namespace.
getCount()
iterator()

add(System.Data.DataTable table)

public void add(System.Data.DataTable table)

Adds the specified DataTable to the collection.

Parameters:

ParameterTypeDescription
tableDataTableThe DataTable object to add.

add(String name)

public System.Data.DataTable add(String name)

Creates a DataTable object by using the specified name and adds it to the collection.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name to give the created DataTable.

Returns: DataTable - The newly created DataTable.

contains(String name)

public boolean contains(String name)

Gets a value that indicates whether a DataTable object with the specified name exists in the collection.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the DataTable to find.

Returns: boolean - true if the specified table exists; otherwise false.

get(int index)

public System.Data.DataTable get(int index)

Gets the DataTable object at the specified index.

Parameters:

ParameterTypeDescription
indexintThe zero-based index of the DataTable to find.

Returns: DataTable - A DataTable.

get(String name)

public System.Data.DataTable get(String name)

Gets the DataTable object with the specified name.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the DataTable to find.

Returns: DataTable - A DataTable with the specified name; otherwise null if the DataTable does not exist.

get(String name, String tableNamespace)

public System.Data.DataTable get(String name, String tableNamespace)

Gets the DataTable object with the specified name in the specified namespace.

Parameters:

ParameterTypeDescription
namejava.lang.StringThe name of the DataTable to find.
tableNamespacejava.lang.StringThe name of the DataTable namespace to look in.

Returns: DataTable - A DataTable with the specified name; otherwise null if the DataTable does not exist.

getCount()

public int getCount()

Returns: int - total number of items in this collection.

iterator()

public Iterator iterator()

Returns: java.util.Iterator