DataColumnMappingCollection.IndexOfDataSetColumn(String) Método
Definição
Obtém o local do DataColumnMapping especificado com o nome de coluna DataSet determinado.Gets the location of the specified DataColumnMapping with the given DataSet column name.
public:
int IndexOfDataSetColumn(System::String ^ dataSetColumn);
public int IndexOfDataSetColumn (string? dataSetColumn);
public int IndexOfDataSetColumn (string dataSetColumn);
member this.IndexOfDataSetColumn : string -> int
Public Function IndexOfDataSetColumn (dataSetColumn As String) As Integer
Parâmetros
- dataSetColumn
- String
O nome, que não diferencia maiúsculas de minúsculas, da coluna do conjunto de dados a ser localizada.The name, which is not case-sensitive, of the data set column to find.
Retornos
O local com base em zero do DataColumnMapping especificado com o nome de coluna DataSet especificado ou -1 se o objeto DataColumnMapping não existir na coleção.The zero-based location of the specified DataColumnMapping with the given DataSet column name, or -1 if the DataColumnMapping object does not exist in the collection.
Exemplos
O exemplo a seguir pesquisa um DataColumnMapping dentro da coleção.The following example searches for a DataColumnMapping within the collection. Se o objeto existir, ele será retornado.If the object exists, it is returned. O exemplo supõe que uma DataColumnMappingCollection coleção e um DataColumnMapping objeto foram criados.The example assumes that a DataColumnMappingCollection collection and a DataColumnMapping object have been created.
public void FindDataColumnMapping()
{
// ...
// create mappings and mapping
// ...
if (mappings.IndexOfDataSetColumn("datadescription") != -1)
mapping = mappings.GetByDataSetColumn("datadescription");
}
Public Sub FindDataColumnMapping()
' ...
' create mappings and mapping
' ...
If mappings.IndexOfDataSetColumn("datadescription") <> - 1 Then
mapping = mappings.GetByDataSetColumn("datadescription")
End If
End Sub