DataColumnMappingCollection.RemoveAt 方法     
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从集合中移除指定的 DataColumnMapping 对象。
重载
| RemoveAt(Int32) | 从集合中移除具有指定索引的 DataColumnMapping 对象。 | 
| RemoveAt(String) | 从集合中移除具有指定源列名称的 DataColumnMapping 对象。 | 
RemoveAt(Int32)
从集合中移除具有指定索引的 DataColumnMapping 对象。
public:
 virtual void RemoveAt(int index);public void RemoveAt (int index);abstract member RemoveAt : int -> unit
override this.RemoveAt : int -> unitPublic Sub RemoveAt (index As Integer)参数
- index
- Int32
要移除的 DataColumnMapping 对象的从零开始的索引。
实现
例外
没有具有指定索引的 DataColumnMapping 对象。
示例
以下示例在集合中DataColumnMappingCollection搜索DataColumnMapping具有给定索引的对象。 DataColumnMapping如果存在,则会删除映射。 此示例假定 DataColumnMappingCollection 已创建集合。
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 对象。
public:
 virtual void RemoveAt(System::String ^ sourceColumn);public void RemoveAt (string sourceColumn);abstract member RemoveAt : string -> unit
override this.RemoveAt : string -> unitPublic Sub RemoveAt (sourceColumn As String)参数
- sourceColumn
- String
区分大小写的源列名称。
实现
例外
没有具有指定源列名称的 DataColumnMapping 对象。
示例
以下示例在集合中DataColumnMappingCollection搜索DataColumnMapping具有给定源列名称的对象。 DataColumnMapping如果存在,则会删除映射。 此示例假定 DataColumnMappingCollection 已创建集合。
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