ITableMappingCollection ITableMappingCollection ITableMappingCollection ITableMappingCollection Interface


含有 TableMapping 物件的集合,並且是由 .NET Framework 資料提供者 (Data Provider) 共同使用的 DataTableMappingCollection 所實作。Contains a collection of TableMapping objects, and is implemented by the DataTableMappingCollection, which is used in common by .NET Framework data providers.

public interface class ITableMappingCollection : System::Collections::IList
public interface ITableMappingCollection : System.Collections.IList
type ITableMappingCollection = interface
    interface IList
    interface ICollection
    interface IEnumerable
Public Interface ITableMappingCollection
Implements IList


下列範例會建立衍生類別中的執行個體DataTableMapping,並將它加入DataTableMappingCollection集合。The following example creates an instance of the derived class, DataTableMapping, and adds it to a DataTableMappingCollection collection. 它接著會通知使用者對應已經加入至集合。It then informs the user that the mapping was added to the collection.

public void AddDataTableMapping() 
    // ...
    // create tableMappings
    // ...
    DataTableMapping mapping =
        new DataTableMapping("Categories","DataCategories");
    tableMappings.Add((Object) mapping);
    Console.WriteLine("Table {0} added to {1} table mapping collection.",
        mapping.ToString(), tableMappings.ToString());
Public Sub AddDataTableMapping()
    ' ...
    ' create tableMappings
    ' ...
    Dim mapping As New DataTableMapping( _
       "Categories", "DataCategories")
    tableMappings.Add(CType(mapping, Object))
    Console.WriteLine( _
       "Table {0} added to {1} table mapping collection.", _
       mapping.ToString(), tableMappings.ToString())
End Sub


ITableMappingCollection介面可讓繼承的類別來實作 TableMapping 集合。The ITableMappingCollection interface allows an inheriting class to implement a TableMapping collection. 如需詳細資訊,請參閱 < DataAdapter DataTable 和 DataColumn 對應For more information, see DataAdapter DataTable and DataColumn Mappings.

應用程式不會建立的執行個體ITableMappingCollection介面直接,但建立繼承的類別的執行個體ITableMappingCollectionAn application does not create an instance of the ITableMappingCollection interface directly, but creates an instance of a class that inherits ITableMappingCollection.

繼承的類別ITableMappingCollection必須實作繼承的成員,並通常會定義要新增提供者特有的功能的其他成員。Classes that inherit ITableMappingCollection must implement the inherited members, and typically define additional members to add provider-specific functionality. 例如,ITableMappingCollection介面會定義的其中一個實作RemoveAt方法。For example, the ITableMappingCollection interface defines one implementation of the RemoveAt method. 依次DataTableMappingCollection類別會繼承這個方法,並定義兩個額外的多載的RemoveAtIn turn, the DataTableMappingCollection class inherits this method, and defines two additional overloads of RemoveAt.


當您繼承自ITableMappingCollection介面,您應該實作下列建構函式:When you inherit from the ITableMappingCollection interface, you should implement the following constructor:

項目Item 描述Description
PrvTableMappingCollection()PrvTableMappingCollection() 建立空的 PrvTableMappingCollection 類別。Creates an empty PrvTableMappingCollection class.


Count Count Count Count

取得 ICollection 中所包含的項目數。Gets the number of elements contained in the ICollection.

(Inherited from ICollection)
IsFixedSize IsFixedSize IsFixedSize IsFixedSize

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

(Inherited from IList)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,指出 IList 是否唯讀。Gets a value indicating whether the IList is read-only.

(Inherited from IList)
IsSynchronized IsSynchronized IsSynchronized IsSynchronized

取得值,這個值表示對 ICollection 的存取是否同步 (安全執行緒)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

(Inherited from ICollection)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

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

(Inherited from IList)
Item[String] Item[String] Item[String] Item[String]

取得或設定具有指定 ITableMapping 名稱之 SourceTable 的執行個體。Gets or sets the instance of ITableMapping with the specified SourceTable name.

SyncRoot SyncRoot SyncRoot SyncRoot

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

(Inherited from ICollection)


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

將項目加入至 IListAdds an item to the IList.

(Inherited from IList)
Add(String, String) Add(String, String) Add(String, String) Add(String, String)

加入資料表對應至集合。Adds a table mapping to the collection.

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

IList 中移除所有項目。Removes all items from the IList.

(Inherited from IList)
Contains(Object) Contains(Object) Contains(Object) Contains(Object)

判斷 IList 是否包含特定值。Determines whether the IList contains a specific value.

(Inherited from IList)
Contains(String) Contains(String) Contains(String) Contains(String)

取得值,表示集合是否包含具有指定來源資料表名稱的資料表對應。Gets a value indicating whether the collection contains a table mapping with the specified source table name.

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

從特定的 ICollection 索引開始,將 Array 的項目複製到 ArrayCopies the elements of the ICollection to an Array, starting at a particular Array index.

(Inherited from ICollection)
GetByDataSetTable(String) GetByDataSetTable(String) GetByDataSetTable(String) GetByDataSetTable(String)

取得具有指定 DataSet 資料表名稱的 TableMapping 物件。Gets the TableMapping object with the specified DataSet table name.

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

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

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

判斷 IList 中指定項目的索引。Determines the index of a specific item in the IList.

(Inherited from IList)
IndexOf(String) IndexOf(String) IndexOf(String) IndexOf(String)

取得集合中 ITableMapping 物件的位置。Gets the location of the ITableMapping object within the collection.

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

將項目插入位於指定索引的 IListInserts an item to the IList at the specified index.

(Inherited from IList)
Remove(Object) Remove(Object) Remove(Object) Remove(Object)

IList 移除特定物件之第一個符合的元素。Removes the first occurrence of a specific object from the IList.

(Inherited from IList)
RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除在指定索引處的 IList 項目。Removes the IList item at the specified index.

(Inherited from IList)
RemoveAt(String) RemoveAt(String) RemoveAt(String) RemoveAt(String)

從集合中移除具有指定 ITableMapping 名稱的 SourceTable 物件。Removes the ITableMapping object with the specified SourceTable name from the collection.

Extension Methods

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)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.