This topic has not yet been rated - Rate this topic

DataTableMappingCollection Class

A collection of DataTableMapping objects. This class cannot be inherited.

System.Object
  System.MarshalByRefObject
    System.Data.Common.DataTableMappingCollection

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)
[ListBindableAttribute(false)]
public sealed class DataTableMappingCollection : MarshalByRefObject, 
	ITableMappingCollection, IList, ICollection, IEnumerable

The DataTableMappingCollection type exposes the following members.

  Name Description
Public method Supported by the XNA Framework DataTableMappingCollection Initializes a new instance of the DataTableMappingCollection class. This new instance is empty, that is, it does not yet contain any DataTableMapping objects.
Top
  Name Description
Public property Supported by the XNA Framework Count Gets the number of DataTableMapping objects in the collection.
Public property Supported by the XNA Framework Item[Int32] Gets or sets the DataTableMapping object at the specified index.
Public property Supported by the XNA Framework Item[String] Gets or sets the DataTableMapping object with the specified source table name.
Top
  Name Description
Public method Supported by the XNA Framework Add(Object) Adds an Object that is a table mapping to the collection.
Public method Supported by the XNA Framework Add(String, String) Adds a DataTableMapping object to the collection when given a source table name and a DataSet table name.
Public method Supported by the XNA Framework AddRange(Array) Copies the elements of the specified Array to the end of the collection.
Public method Supported by the XNA Framework AddRange(DataTableMapping[]) Copies the elements of the specified DataTableMapping array to the end of the collection.
Public method Supported by the XNA Framework Clear Removes all DataTableMapping objects from the collection.
Public method Supported by the XNA Framework Contains(Object) Gets a value indicating whether the given DataTableMapping object exists in the collection.
Public method Supported by the XNA Framework Contains(String) Gets a value indicating whether a DataTableMapping object with the specified source table name exists in the collection.
Public method Supported by the XNA Framework CopyTo(Array, Int32) Copies the elements of the DataTableMappingCollection to the specified array.
Public method Supported by the XNA Framework CopyTo(DataTableMapping[], Int32) Copies the elements of the DataTableMapping to the specified array.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method Supported by the XNA Framework Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Supported by the XNA Framework Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by the XNA Framework GetByDataSetTable Gets the DataTableMapping object with the specified DataSet table name.
Public method Supported by the XNA Framework GetEnumerator Gets an enumerator that can iterate through the collection.
Public method Supported by the XNA Framework GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method Static member Supported by the XNA Framework GetTableMappingBySchemaAction Gets a DataColumnMapping object with the specified source table name and DataSet table name, using the given MissingMappingAction.
Public method Supported by the XNA Framework GetType Gets the Type of the current instance. (Inherited from Object.)
Public method Supported by the XNA Framework IndexOf(Object) Gets the location of the specified DataTableMapping object within the collection.
Public method Supported by the XNA Framework IndexOf(String) Gets the location of the DataTableMapping object with the specified source table name.
Public method Supported by the XNA Framework IndexOfDataSetTable Gets the location of the DataTableMapping object with the specified DataSet table name.
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method Supported by the XNA Framework Insert(Int32, DataTableMapping) Inserts a DataTableMapping object into the DataTableMappingCollection at the specified index.
Public method Supported by the XNA Framework Insert(Int32, Object) Inserts a DataTableMapping object into the DataTableMappingCollection at the specified index.
Protected method Supported by the XNA Framework MemberwiseClone() Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method MemberwiseClone(Boolean) Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Public method Supported by the XNA Framework Remove(DataTableMapping) Removes the specified DataTableMapping object from the collection.
Public method Supported by the XNA Framework Remove(Object) Removes the specified DataTableMapping object from the collection.
Public method Supported by the XNA Framework RemoveAt(Int32) Removes the DataTableMapping object located at the specified index from the collection.
Public method Supported by the XNA Framework RemoveAt(String) Removes the DataTableMapping object with the specified source table name from the collection.
Public method Supported by the XNA Framework ToString Returns a string that represents the current object. (Inherited from Object.)
Top
  Name Description
Public Extension Method AsParallel Enables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension Method AsQueryable Converts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension Method Supported by the XNA Framework Cast<TResult> Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension Method Supported by the XNA Framework OfType<TResult> Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top
  Name Description
Explicit interface implemetation Private property Supported by the XNA Framework ICollection.IsSynchronized Gets a value indicating whether access to the ICollection is synchronized (thread safe).
Explicit interface implemetation Private property Supported by the XNA Framework ICollection.SyncRoot Gets an object that can be used to synchronize access to the ICollection.
Explicit interface implemetation Private property Supported by the XNA Framework IList.IsFixedSize Gets a value indicating whether the IList has a fixed size.
Explicit interface implemetation Private property Supported by the XNA Framework IList.IsReadOnly Gets a value indicating whether the IList is read-only.
Explicit interface implemetation Private property Supported by the XNA Framework IList.Item Gets or sets an item from the collection at a specified index.
Explicit interface implemetation Private method Supported by the XNA Framework ITableMappingCollection.Add Adds a table mapping to the collection.
Explicit interface implemetation Private method Supported by the XNA Framework ITableMappingCollection.GetByDataSetTable Gets the TableMapping object with the specified DataSet table name.
Explicit interface implemetation Private property Supported by the XNA Framework ITableMappingCollection.Item Gets or sets the instance of ITableMapping with the specified SourceTable name.
Top

The following example uses an OleDbDataAdapter to Add DataTableMapping objects to its TableMappings collection, and then displays a list of those mapped source tables. 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);
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ