DataColumnMappingCollection 類別

定義

包含 DataColumnMapping 物件的集合。Contains a collection of DataColumnMapping objects.

public ref class DataColumnMappingCollection sealed : MarshalByRefObject, System::Collections::IList, System::Data::IColumnMappingCollection
public ref class DataColumnMappingCollection sealed : MarshalByRefObject, System::Data::IColumnMappingCollection
public sealed class DataColumnMappingCollection : MarshalByRefObject, System.Collections.IList, System.Data.IColumnMappingCollection
public sealed class DataColumnMappingCollection : MarshalByRefObject, System.Data.IColumnMappingCollection
type DataColumnMappingCollection = class
    inherit MarshalByRefObject
    interface ICollection
    interface IEnumerable
    interface IList
    interface IColumnMappingCollection
type DataColumnMappingCollection = class
    inherit MarshalByRefObject
    interface IColumnMappingCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public NotInheritable Class DataColumnMappingCollection
Inherits MarshalByRefObject
Implements IColumnMappingCollection, IList
Public NotInheritable Class DataColumnMappingCollection
Inherits MarshalByRefObject
Implements IColumnMappingCollection
繼承
DataColumnMappingCollection
實作

範例

下列範例會在 DataTableMapping Add 其集合中使用至數個 DataColumnMapping 物件 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()

建立空的 DataColumnMappingCollectionCreates an empty DataColumnMappingCollection.

屬性

Count

取得集合中 DataColumnMapping 物件的數目。Gets the number of DataColumnMapping objects in the collection.

Item[Int32]

取得或設定在指定索引處的 DataColumnMapping 物件。Gets or sets the DataColumnMapping object at the specified index.

Item[String]

取得或設定具有指定來源資料行名稱的 DataColumnMapping 物件。Gets or sets the DataColumnMapping object with the specified source column name.

方法

Add(Object)

DataColumnMapping 物件加入至集合。Adds a DataColumnMapping object to the collection.

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)

將指定 Array 的元素複製到集合結尾。Copies the elements of the specified Array to the end of the collection.

AddRange(DataColumnMapping[])

將指定的 DataColumnMapping 陣列元素複製到集合的末端。Copies the elements of the specified DataColumnMapping array to the end of the collection.

Clear()

從集合中移除所有 DataColumnMapping 物件。Removes all DataColumnMapping objects from the collection.

Contains(Object)

取得值,指出具有指定 DataColumnMappingObject 物件是否存在於集合中。Gets a value indicating whether a DataColumnMapping object with the given Object exists in the collection.

Contains(String)

取得值,指出具有指定來源資料行名稱的 DataColumnMapping 物件是否存在於集合中。Gets a value indicating whether a DataColumnMapping object with the given source column name exists in the collection.

CopyTo(Array, Int32)

DataColumnMappingCollection 的元素複製到指定的陣列。Copies the elements of the DataColumnMappingCollection to the specified array.

CopyTo(DataColumnMapping[], Int32)

複製 DataColumnMappingCollection 的項目至指定的 DataColumnMapping 陣列。Copies the elements of the DataColumnMappingCollection to the specified DataColumnMapping array.

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetByDataSetColumn(String)

取得具有指定 DataColumnMapping 資料行名稱的 DataSet 物件。Gets the DataColumnMapping object with the specified DataSet column name.

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)

靜態 (Static) 方法,傳回 DataColumn 物件,而無需對 DataColumnMappingCollection 物件執行個體化。A static method that returns a DataColumn object without instantiating a DataColumnMappingCollection object.

GetEnumerator()

取得可以逐一查看集合的列舉程式。Gets an enumerator that can iterate through the collection.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetLifetimeService()
已過時。

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IndexOf(Object)

取得在集合中為 Object 的指定 DataColumnMapping 位置。Gets the location of the specified Object that is a DataColumnMapping within the collection.

IndexOf(String)

取得具有指定來源資料行名稱的 DataColumnMapping 位置。Gets the location of the DataColumnMapping with the specified source column name.

IndexOfDataSetColumn(String)

取得具有指定 DataColumnMapping 資料行名稱的指定 DataSet 位置。Gets the location of the specified DataColumnMapping with the given DataSet column name.

InitializeLifetimeService()
已過時。

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
Insert(Int32, DataColumnMapping)

DataColumnMapping 物件插入 DataColumnMappingCollection 的指定索引處。Inserts a DataColumnMapping object into the DataColumnMappingCollection at the specified index.

Insert(Int32, Object)

DataColumnMapping 物件插入 DataColumnMappingCollection 的指定索引處。Inserts a DataColumnMapping object into the DataColumnMappingCollection at the specified index.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
Remove(DataColumnMapping)

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

Remove(Object)

從集合移除為 ObjectDataColumnMappingRemoves the Object that is a DataColumnMapping 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.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

ICollection.IsSynchronized

取得值,指出是否可同步存取 ICollection (安全執行緒)。Gets a value that indicates whether access to the ICollection is synchronized (thread safe).

ICollection.SyncRoot

取得可用以同步存取 ICollection 的物件。Gets an object that can be used to synchronize access to the ICollection.

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)

取得具有指定之 DataColumnMapping 資料行名稱的 DataSet 物件。Gets the DataColumnMapping object that has the specified DataSet column name.

IColumnMappingCollection.Item[String]

取得或設定具有指定 SourceColumn 名稱的 IColumnMapping 物件。Gets or sets the IColumnMapping object with the specified SourceColumn name.

IList.IsFixedSize

取得值,指出 IList 是否有固定的大小。Gets a value that indicates whether the IList has a fixed size.

IList.IsReadOnly

取得值,這個值表示 IList 是否為唯讀。Gets a value that indicates whether the IList is read-only.

IList.Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱