Редактиране

Споделяне чрез


DataColumnMappingCollection.GetByDataSetColumn(String) Method

Definition

Gets the DataColumnMapping object with the specified DataSet column name.

public:
 System::Data::Common::DataColumnMapping ^ GetByDataSetColumn(System::String ^ value);
public System.Data.Common.DataColumnMapping GetByDataSetColumn (string value);
member this.GetByDataSetColumn : string -> System.Data.Common.DataColumnMapping
Public Function GetByDataSetColumn (value As String) As DataColumnMapping

Parameters

value
String

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

Returns

The DataColumnMapping object with the specified DataSet column name.

Examples

The following example searches for a DataColumnMapping within the collection. If the object exists, it is returned. 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

Applies to

See also