DataTableMappingCollection DataTableMappingCollection DataTableMappingCollection DataTableMappingCollection Class

定義

DataTableMapping 物件的集合。A collection of DataTableMapping objects. 這個類別無法被繼承。This class cannot be inherited.

public ref class DataTableMappingCollection sealed : MarshalByRefObject, System::Collections::IList, System::Data::ITableMappingCollection
[System.ComponentModel.ListBindable(false)]
public sealed class DataTableMappingCollection : MarshalByRefObject, System.Collections.IList, System.Data.ITableMappingCollection
type DataTableMappingCollection = class
    inherit MarshalByRefObject
    interface ITableMappingCollection
    interface IList
    interface ICollection
    interface IEnumerable
Public NotInheritable Class DataTableMappingCollection
Inherits MarshalByRefObject
Implements IList, ITableMappingCollection
繼承
DataTableMappingCollectionDataTableMappingCollectionDataTableMappingCollectionDataTableMappingCollection
屬性
實作

範例

下列範例會使用OleDbDataAdapterAddDataTableMapping物件新增至其TableMappings集合,然後按一下 顯示清單對應來源資料表。The following example uses an OleDbDataAdapter to AddDataTableMapping objects to its TableMappings collection, and then displays a list of those mapped source tables. 這個範例假設OleDbDataAdapter已經存在。This example assumes that an OleDbDataAdapter has already been created.

public void ShowTableMappings() 
{
    // ...
    // create adapter
    // ...
    adapter.TableMappings.Add("Categories","DataCategories");
    adapter.TableMappings.Add("Orders","DataOrders");
    adapter.TableMappings.Add("Products","DataProducts");
    string message = "Table Mappings:\n";
    for(int i=0;i < adapter.TableMappings.Count;i++) 
    {
        message += i.ToString() + " "
            + adapter.TableMappings[i].ToString() + "\n";
    }
    Console.WriteLine(message);
}
Public Sub ShowTableMappings()
    ' ...
    ' create adapter
    ' ...
    adapter.TableMappings.Add("Categories", "DataCategories")
    adapter.TableMappings.Add("Orders", "DataOrders")
    adapter.TableMappings.Add("Products", "DataProducts")
    Dim message As String = "Table Mappings:" & ControlChars.Cr
    Dim i As Integer
    For i = 0 To adapter.TableMappings.Count - 1
        message &= i.ToString() & " " _
           & adapter.TableMappings(i).ToString() & ControlChars.Cr
    Next i
    Console.WriteLine(message)
End Sub

建構函式

DataTableMappingCollection() DataTableMappingCollection() DataTableMappingCollection() DataTableMappingCollection()

初始化 DataTableMappingCollection 類別的新執行個體。Initializes a new instance of the DataTableMappingCollection class. 這個新執行個體 (Instance) 是空的,也就是說,它尚未含有任何 DataTableMapping 物件。This new instance is empty, that is, it does not yet contain any DataTableMapping objects.

屬性

Count Count Count Count

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

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

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

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

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

方法

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

加入即是資料表對應的 Object 至集合。Adds an Object that is a table mapping to the collection.

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

在提供來源資料表名稱和 DataTableMapping 資料表名稱時,將 DataSet 物件加入至集合。Adds a DataTableMapping object to the collection when given a source table name and a DataSet table name.

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

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

AddRange(DataTableMapping[]) AddRange(DataTableMapping[]) AddRange(DataTableMapping[]) AddRange(DataTableMapping[])

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

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

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

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

取得值,指出指定的 DataTableMapping 物件是否存在於集合。Gets a value indicating whether the given DataTableMapping object exists in the collection.

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

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

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

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

CopyTo(DataTableMapping[], Int32) CopyTo(DataTableMapping[], Int32) CopyTo(DataTableMapping[], Int32) CopyTo(DataTableMapping[], Int32)

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

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

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。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)
GetByDataSetTable(String) GetByDataSetTable(String) GetByDataSetTable(String) GetByDataSetTable(String)

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

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

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

(Inherited from MarshalByRefObject)
GetTableMappingBySchemaAction(DataTableMappingCollection, String, String, MissingMappingAction) GetTableMappingBySchemaAction(DataTableMappingCollection, String, String, MissingMappingAction) GetTableMappingBySchemaAction(DataTableMappingCollection, String, String, MissingMappingAction) GetTableMappingBySchemaAction(DataTableMappingCollection, String, String, MissingMappingAction)

使用指定的 DataColumnMapping 來取得具有指定來源資料表名稱和 DataSet 資料表名稱的 MissingMappingAction 物件。Gets a DataColumnMapping object with the specified source table name and DataSet table name, using the given MissingMappingAction.

GetType() GetType() GetType() GetType()

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

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

取得集合中指定的 DataTableMapping 物件位置。Gets the location of the specified DataTableMapping object within the collection.

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

取得具有指定來源資料表名稱的 DataTableMapping 物件位置。Gets the location of the DataTableMapping object with the specified source table name.

IndexOfDataSetTable(String) IndexOfDataSetTable(String) IndexOfDataSetTable(String) IndexOfDataSetTable(String)

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

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

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

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

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

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

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

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

建立目前 Object 的淺層複本 (Shallow Copy)。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(DataTableMapping) Remove(DataTableMapping) Remove(DataTableMapping) Remove(DataTableMapping)

從集合中移除指定的 DataTableMapping 物件。Removes the specified DataTableMapping object from the collection.

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

從集合中移除指定的 DataTableMapping 物件。Removes the specified DataTableMapping object from the collection.

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

從集合移除位在指定索引處的 DataTableMapping 物件。Removes the DataTableMapping object located at the specified index from the collection.

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

從集合移除具有指定來源資料表名稱的 DataTableMapping 物件。Removes the DataTableMapping object with the specified source table 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 indicating 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.

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

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

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

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

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

從集合中取得或設定在指定索引的項目。Gets or sets an item from the collection at a specified index.

ITableMappingCollection.Add(String, String) ITableMappingCollection.Add(String, String) ITableMappingCollection.Add(String, String) ITableMappingCollection.Add(String, String)

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

ITableMappingCollection.GetByDataSetTable(String) ITableMappingCollection.GetByDataSetTable(String) ITableMappingCollection.GetByDataSetTable(String) ITableMappingCollection.GetByDataSetTable(String)

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

ITableMappingCollection.Item[String] ITableMappingCollection.Item[String] ITableMappingCollection.Item[String] ITableMappingCollection.Item[String]

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

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.

適用於