DataColumnMappingCollection.RemoveAt 方法

定义

从集合中移除指定的 DataColumnMapping 对象。Removes the specified DataColumnMapping object from the collection.

重载

RemoveAt(Int32)

从集合中移除具有指定索引的 DataColumnMapping 对象。Removes the DataColumnMapping object with the specified index from the collection.

RemoveAt(String)

从集合中移除具有指定源列名称的 DataColumnMapping 对象。Removes the DataColumnMapping object with the specified source column name from the collection.

RemoveAt(Int32)

从集合中移除具有指定索引的 DataColumnMapping 对象。Removes the DataColumnMapping object with the specified index from the collection.

public:
 virtual void RemoveAt(int index);
public void RemoveAt (int index);
abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unit
Public Sub RemoveAt (index As Integer)

参数

index
Int32

要移除的 DataColumnMapping 对象的从零开始的索引。The zero-based index of the DataColumnMapping object to remove.

实现

例外

没有具有指定索引的 DataColumnMapping 对象。There is no DataColumnMapping object with the specified index.

示例

下面的示例在 DataColumnMapping 集合中搜索具有给定索引的对象 DataColumnMappingCollectionThe following example searches for a DataColumnMapping object with the given index within a DataColumnMappingCollection collection. 如果 DataColumnMapping 存在,则删除该映射。If the DataColumnMapping exists, the mapping is removed. 此示例假设 DataColumnMappingCollection 已创建一个集合。This example assumes that a DataColumnMappingCollection collection has been created.


public void RemoveDataColumnMapping()
{
    // ...
    // create mappings
    // ...
    if (mappings.Contains(7))
        mappings.RemoveAt(7);
}
Public Sub RemoveDataColumnMapping()
    ' ...
    ' create mappings
    ' ...
    If mappings.Contains(7) Then
        mappings.RemoveAt(7)
    End If
End Sub

适用于

RemoveAt(String)

从集合中移除具有指定源列名称的 DataColumnMapping 对象。Removes the DataColumnMapping object with the specified source column name from the collection.

public:
 virtual void RemoveAt(System::String ^ sourceColumn);
public void RemoveAt (string sourceColumn);
abstract member RemoveAt : string -> unit
override this.RemoveAt : string -> unit
Public Sub RemoveAt (sourceColumn As String)

参数

sourceColumn
String

区分大小写的源列名称。The case-sensitive source column name.

实现

例外

没有具有指定源列名称的 DataColumnMapping 对象。There is no DataColumnMapping object with the specified source column name.

示例

下面的示例在 DataColumnMapping 集合中搜索具有给定源列名称的对象 DataColumnMappingCollectionThe following example searches for a DataColumnMapping object with the given source column name within a DataColumnMappingCollection collection. 如果 DataColumnMapping 存在,则删除该映射。If the DataColumnMapping exists, the mapping is removed. 此示例假设 DataColumnMappingCollection 已创建一个集合。This example assumes that a DataColumnMappingCollection collection has been created.


public void RemoveDataColumnMapping()
{
    // ...
    // create columnMappings
    // ...
    if (columnMappings.Contains("Picture"))
        columnMappings.RemoveAt("Picture");
}
Public Sub RemoveDataColumnMapping()
    ' ...
    ' create columnMappings
    ' ...
    If columnMappings.Contains("Picture") Then
        columnMappings.RemoveAt("Picture")
    End If
End Sub

适用于