DataColumnMappingCollection 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
包含 DataColumnMapping 对象的集合。
public ref class DataColumnMappingCollection sealed : MarshalByRefObject, System::Collections::IList, System::Data::IColumnMappingCollectionpublic ref class DataColumnMappingCollection sealed : MarshalByRefObject, System::Data::IColumnMappingCollectionpublic sealed class DataColumnMappingCollection : MarshalByRefObject, System.Collections.IList, System.Data.IColumnMappingCollectionpublic sealed class DataColumnMappingCollection : MarshalByRefObject, System.Data.IColumnMappingCollectiontype DataColumnMappingCollection = class
    inherit MarshalByRefObject
    interface ICollection
    interface IEnumerable
    interface IList
    interface IColumnMappingCollectiontype DataColumnMappingCollection = class
    inherit MarshalByRefObject
    interface IColumnMappingCollection
    interface IList
    interface ICollection
    interface IEnumerablePublic NotInheritable Class DataColumnMappingCollection
Inherits MarshalByRefObject
Implements IColumnMappingCollection, IListPublic NotInheritable Class DataColumnMappingCollection
Inherits MarshalByRefObject
Implements IColumnMappingCollection- 继承
- 实现
示例
下面的示例使用 DataTableMapping 到Add其ColumnMappings集合中的多个 DataColumnMapping 对象,然后显示这些映射的源列的列表。 此示例假定 DataTableMapping 已创建 。
public void ShowColumnMappings()
{
    // ...
    // create tableMapping
    // ...
    tableMapping.ColumnMappings.Add("Category Name","DataCategory");
    tableMapping.ColumnMappings.Add("Description","DataDescription");
    tableMapping.ColumnMappings.Add("Picture","DataPicture");
    Console.WriteLine("Column Mappings");
    for(int i=0;i < tableMapping.ColumnMappings.Count;i++)
    {
        Console.WriteLine("  {0} {1}", i,
            tableMapping.ColumnMappings[i].ToString());
    }
}
Public Sub ShowColumnMappings()
    ' ...
    ' create tableMapping
    ' ...
    tableMapping.ColumnMappings.Add( _
       "Category Name", "DataCategory")
    tableMapping.ColumnMappings.Add( _
       "Description", "DataDescription")
    tableMapping.ColumnMappings.Add( _
       "Picture", "DataPicture")
    Console.WriteLine("Column Mappings:")
    Dim i As Integer
    For i = 0 To tableMapping.ColumnMappings.Count - 1
        Console.WriteLine("  {0} {1}", i, _
           tableMapping.ColumnMappings(i).ToString())
    Next i
End Sub
构造函数
| DataColumnMappingCollection() | 创建一个空的 DataColumnMappingCollection。 | 
属性
| Count | 获取集合中 DataColumnMapping 对象的数量。 | 
| Item[Int32] | 获取或设置位于指定索引处的 DataColumnMapping 对象。 | 
| Item[String] | 获取或设置具有指定源列名称的 DataColumnMapping 对象。 | 
方法
显式接口实现
| ICollection.IsSynchronized | 获取一个值,该值指示是否同步对 ICollection 的访问(线程安全)。 | 
| ICollection.SyncRoot | 获取可用于同步对 ICollection 的访问的对象。 | 
| IColumnMappingCollection.Add(String, String) | 使用源列名和 DataColumnMapping 列名将 DataColumnMappingCollection 对象添加到 DataSet。 | 
| IColumnMappingCollection.GetByDataSetColumn(String) | 获取具有指定的 DataColumnMapping 列名的 DataSet 对象。 | 
| IColumnMappingCollection.Item[String] | 获取或设置具有指定  | 
| IList.IsFixedSize | 获取一个值,该值指示 IList 是否具有固定大小。 | 
| IList.IsReadOnly | 获取一个值,该值指示 IList 是否为只读。 | 
| IList.Item[Int32] | 获取或设置指定索引处的元素。 | 
扩展方法
| Cast<TResult>(IEnumerable) | 将 IEnumerable 的元素强制转换为指定的类型。 | 
| OfType<TResult>(IEnumerable) | 根据指定类型筛选 IEnumerable 的元素。 | 
| AsParallel(IEnumerable) | 启用查询的并行化。 | 
| AsQueryable(IEnumerable) | 将 IEnumerable 转换为 IQueryable。 |