DataColumnMappingCollection DataColumnMappingCollection DataColumnMappingCollection DataColumnMappingCollection Class

定义

包含 DataColumnMapping 对象的集合。Contains a collection of DataColumnMapping objects.

public ref class DataColumnMappingCollection sealed : MarshalByRefObject, System::Collections::IList, System::Data::IColumnMappingCollection
public sealed class DataColumnMappingCollection : MarshalByRefObject, System.Collections.IList, System.Data.IColumnMappingCollection
type DataColumnMappingCollection = class
    inherit MarshalByRefObject
    interface IColumnMappingCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public NotInheritable Class DataColumnMappingCollection
Inherits MarshalByRefObject
Implements IColumnMappingCollection, IList
继承
DataColumnMappingCollectionDataColumnMappingCollectionDataColumnMappingCollectionDataColumnMappingCollection
实现

示例

下面的示例使用一个DataTableMappingAddDataColumnMapping个对象ColumnMappings的集合, 然后显示这些映射源列的列表。The following example uses a DataTableMapping to Add several DataColumnMapping objects to its ColumnMappings collection, and then displays a list of those mapped source columns. 本示例假定已创建DataTableMapping了。This example assumes that a DataTableMapping has already been created.


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() DataColumnMappingCollection() DataColumnMappingCollection()

创建一个空的 DataColumnMappingCollectionCreates an empty DataColumnMappingCollection.

属性

Count Count Count Count

获取集合中 DataColumnMapping 对象的数量。Gets the number of DataColumnMapping objects in the collection.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取或设置位于指定索引处的 DataColumnMapping 对象。Gets or sets the DataColumnMapping object at the specified index.

Item[String] Item[String] Item[String] Item[String]

获取或设置具有指定源列名称的 DataColumnMapping 对象。Gets or sets the DataColumnMapping object with the specified source column name.

方法

Add(Object) Add(Object) Add(Object) Add(Object)

DataColumnMapping 对象添加到集合中。Adds a DataColumnMapping object to the collection.

Add(String, String) Add(String, String) Add(String, String) Add(String, String)

当给定源列名称和 DataColumnMapping 列名时,将 DataSet 对象添加到集合中。Adds a DataColumnMapping object to the collection when given a source column name and a DataSet column name.

AddRange(Array) AddRange(Array) AddRange(Array) AddRange(Array)

将指定的 Array 的元素复制到集合末尾。Copies the elements of the specified Array to the end of the collection.

AddRange(DataColumnMapping[]) AddRange(DataColumnMapping[]) AddRange(DataColumnMapping[]) AddRange(DataColumnMapping[])

将指定的 DataColumnMapping 数组的元素复制到集合末尾。Copies the elements of the specified DataColumnMapping array to the end of the collection.

Clear() Clear() Clear() Clear()

从集合中删除所有 DataColumnMapping 对象。Removes all DataColumnMapping objects from the collection.

Contains(Object) Contains(Object) Contains(Object) Contains(Object)

获取一个值,该值指示集合中是否存在具有给定 DataColumnMappingObject 对象。Gets a value indicating whether a DataColumnMapping object with the given Object exists in the collection.

Contains(String) Contains(String) Contains(String) Contains(String)

获取一个值,该值指示集合中是否存在具有给定源列名称的 DataColumnMapping 对象。Gets a value indicating whether a DataColumnMapping object with the given source column name exists in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

DataColumnMappingCollection 的元素复制到指定的数组。Copies the elements of the DataColumnMappingCollection to the specified array.

CopyTo(DataColumnMapping[], Int32) CopyTo(DataColumnMapping[], Int32) CopyTo(DataColumnMapping[], Int32) CopyTo(DataColumnMapping[], Int32)

DataColumnMappingCollection 的元素复制到指定的 DataColumnMapping 数组。Copies the elements of the DataColumnMappingCollection to the specified DataColumnMapping array.

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetByDataSetColumn(String) GetByDataSetColumn(String) GetByDataSetColumn(String) GetByDataSetColumn(String)

获取具有指定 DataColumnMapping 列名的 DataSet 对象。Gets the DataColumnMapping object with the specified DataSet column name.

GetColumnMappingBySchemaAction(DataColumnMappingCollection, String, MissingMappingAction) GetColumnMappingBySchemaAction(DataColumnMappingCollection, String, MissingMappingAction) GetColumnMappingBySchemaAction(DataColumnMappingCollection, String, MissingMappingAction) GetColumnMappingBySchemaAction(DataColumnMappingCollection, String, MissingMappingAction)

给指定的 DataColumnMapping、源列名称和 DataColumnMappingCollection 获取一个 MissingMappingActionGets a DataColumnMapping for the specified DataColumnMappingCollection, source column name, and MissingMappingAction.

GetDataColumn(DataColumnMappingCollection, String, Type, DataTable, MissingMappingAction, MissingSchemaAction) GetDataColumn(DataColumnMappingCollection, String, Type, DataTable, MissingMappingAction, MissingSchemaAction) GetDataColumn(DataColumnMappingCollection, String, Type, DataTable, MissingMappingAction, MissingSchemaAction) GetDataColumn(DataColumnMappingCollection, String, Type, DataTable, MissingMappingAction, MissingSchemaAction)

一个静态方法,它返回未实例化的 DataColumn 对象的 DataColumnMappingCollection 对象。A static method that returns a DataColumn object without instantiating a DataColumnMappingCollection object.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

获取可循环访问集合的枚举数。Gets an enumerator that can iterate through the collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(Object) IndexOf(Object) IndexOf(Object) IndexOf(Object)

获取指定的 Object(它是 DataColumnMapping)在集合中的位置。Gets the location of the specified Object that is a DataColumnMapping within the collection.

IndexOf(String) IndexOf(String) IndexOf(String) IndexOf(String)

获取具有指定源列名称的 DataColumnMapping 的位置。Gets the location of the DataColumnMapping with the specified source column name.

IndexOfDataSetColumn(String) IndexOfDataSetColumn(String) IndexOfDataSetColumn(String) IndexOfDataSetColumn(String)

获取具有给定 DataColumnMapping 列名的指定 DataSet 的位置。Gets the location of the specified DataColumnMapping with the given DataSet column name.

InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

获取生存期服务对象来控制此实例的生存期策略。Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
Insert(Int32, DataColumnMapping) Insert(Int32, DataColumnMapping) Insert(Int32, DataColumnMapping) Insert(Int32, DataColumnMapping)

DataColumnMapping 中的指定索引处插入一个 DataColumnMappingCollection 对象。Inserts a DataColumnMapping object into the DataColumnMappingCollection at the specified index.

Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object) Insert(Int32, Object)

DataColumnMapping 中的指定索引处插入一个 DataColumnMappingCollection 对象。Inserts a DataColumnMapping object into the DataColumnMappingCollection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

创建当前 MarshalByRefObject 对象的浅表副本。Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
Remove(DataColumnMapping) Remove(DataColumnMapping) Remove(DataColumnMapping) Remove(DataColumnMapping)

从集合中移除指定的 DataColumnMappingRemoves the specified DataColumnMapping from the collection.

Remove(Object) Remove(Object) Remove(Object) Remove(Object)

从集合中移除 Object,它是一个 DataColumnMappingRemoves the Object that is a DataColumnMapping from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

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

RemoveAt(String) RemoveAt(String) RemoveAt(String) RemoveAt(String)

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

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

获取一个值,该值指示对 ICollection 的访问是否同步(线程安全)。Gets a value that indicates whether access to the ICollection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

获取可用于同步对 ICollection 的访问的对象。Gets an object that can be used to synchronize access to the ICollection.

IColumnMappingCollection.Add(String, String) IColumnMappingCollection.Add(String, String) IColumnMappingCollection.Add(String, String) IColumnMappingCollection.Add(String, String)

使用源列名和 DataColumnMapping 列名将 DataColumnMappingCollection 对象添加到 DataSetAdds a DataColumnMapping object to the DataColumnMappingCollection by using the source column and DataSet column names.

IColumnMappingCollection.GetByDataSetColumn(String) IColumnMappingCollection.GetByDataSetColumn(String) IColumnMappingCollection.GetByDataSetColumn(String) IColumnMappingCollection.GetByDataSetColumn(String)

获取具有指定的 DataColumnMapping 列名的 DataSet 对象。Gets the DataColumnMapping object that has the specified DataSet column name.

IColumnMappingCollection.Item[String] IColumnMappingCollection.Item[String] IColumnMappingCollection.Item[String] IColumnMappingCollection.Item[String]

获取或设置具有指定 SourceColumn 名称的 IColumnMapping 对象。Gets or sets the IColumnMapping object with the specified SourceColumn name.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

获取一个值,该值指示 IList 是否具有固定大小。Gets a value that indicates whether the IList has a fixed size.

IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

获取一个值,该值指示 IList 是否为只读。Gets a value that indicates whether the IList is read-only.

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

获取或设置指定索引处的元素。Gets or sets the element at the specified index.

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅