DataColumnMappingCollection 類別

定義

包含 DataColumnMapping 物件的集合。

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 至其 ColumnMappings 集合中的 數個 Add 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 物件。

方法

Add(Object)

DataColumnMapping 物件加入至集合。

Add(String, String)

在提供來源資料行名稱和 DataColumnMapping 資料行名稱時,將 DataSet 物件加入至集合。

AddRange(Array)

將指定 Array 的元素複製到集合結尾。

AddRange(DataColumnMapping[])

將指定的 DataColumnMapping 陣列元素複製到集合的末端。

Clear()

從集合中移除所有 DataColumnMapping 物件。

Contains(Object)

取得值,指出具有指定 DataColumnMappingObject 物件是否存在於集合中。

Contains(String)

取得值,指出具有指定來源資料行名稱的 DataColumnMapping 物件是否存在於集合中。

CopyTo(Array, Int32)

DataColumnMappingCollection 的元素複製到指定的陣列。

CopyTo(DataColumnMapping[], Int32)

複製 DataColumnMappingCollection 的項目至指定的 DataColumnMapping 陣列。

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。

(繼承來源 MarshalByRefObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetByDataSetColumn(String)

取得具有指定 DataColumnMapping 資料行名稱的 DataSet 物件。

GetColumnMappingBySchemaAction(DataColumnMappingCollection, String, MissingMappingAction)

為指定 DataColumnMapping、來源資料行名稱和 DataColumnMappingCollection 取得 MissingMappingAction

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

靜態 (Static) 方法,傳回 DataColumn 物件,而無需對 DataColumnMappingCollection 物件執行個體化。

GetEnumerator()

取得可以逐一查看集合的列舉程式。

GetHashCode()

做為預設雜湊函式。

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

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。

(繼承來源 MarshalByRefObject)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IndexOf(Object)

取得在集合中為 Object 的指定 DataColumnMapping 位置。

IndexOf(String)

取得具有指定來源資料行名稱的 DataColumnMapping 位置。

IndexOfDataSetColumn(String)

取得具有指定 DataColumnMapping 資料行名稱的指定 DataSet 位置。

InitializeLifetimeService()
已過時。

取得存留期服務物件,以控制這個執行個體的存留期原則。

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

DataColumnMapping 物件插入 DataColumnMappingCollection 的指定索引處。

Insert(Int32, Object)

DataColumnMapping 物件插入 DataColumnMappingCollection 的指定索引處。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。

(繼承來源 MarshalByRefObject)
Remove(DataColumnMapping)

從集合移除指定的 DataColumnMapping

Remove(Object)

從集合移除為 ObjectDataColumnMapping

RemoveAt(Int32)

從集合移除具有指定索引的 DataColumnMapping 物件。

RemoveAt(String)

從集合移除具有指定來源資料列名稱的 DataColumnMapping 物件。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

ICollection.IsSynchronized

取得值,指出是否可同步存取 ICollection (安全執行緒)。

ICollection.SyncRoot

取得可用以同步存取 ICollection 的物件。

IColumnMappingCollection.Add(String, String)

使用來源資料行和 DataColumnMapping 資料行名稱,將 DataColumnMappingCollection 物件加入至 DataSet

IColumnMappingCollection.GetByDataSetColumn(String)

取得具有指定之 DataColumnMapping 資料行名稱的 DataSet 物件。

IColumnMappingCollection.Item[String]

取得或設定具有指定 SourceColumn 名稱的 IColumnMapping 物件。

IList.IsFixedSize

取得值,指出 IList 是否有固定的大小。

IList.IsReadOnly

取得值,這個值表示 IList 是否為唯讀。

IList.Item[Int32]

在指定的索引位置上取得或設定項目。

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱