DataTableMappingCollection.IndexOfDataSetTable(String) Method

Definition

Gets the location of the DataTableMapping object with the specified DataSet table name.

C#
public int IndexOfDataSetTable(string? dataSetTable);
C#
public int IndexOfDataSetTable(string dataSetTable);

Parameters

dataSetTable
String

The name, which is not case-sensitive, of the DataSet table to find.

Returns

The zero-based location of the DataTableMapping object with the given DataSet table name, or -1 if the DataTableMapping object does not exist in the collection.

Examples

The following example searches for a DataTableMapping within the collection. If the object exists, it is returned. The example assumes that a DataTableMappingCollection collection and a DataTableMapping object have been created.

C#
public void FindDataTableMapping()
{
    // ...
    // create mappings and mapping
    // ...
    if (mappings.IndexOfDataSetTable("datacategories") != -1)
        mapping = mappings.GetByDataSetTable("datacategories");
}

Applies to

Tuote Versiot
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1