Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IColumnMappingCollection Interface

Contains a collection of DataColumnMapping objects, and is implemented by the DataColumnMappingCollection, which is used in common by .NET Framework data providers.

Namespace:  System.Data
Assembly:  System.Data (in System.Data.dll)
public interface IColumnMappingCollection : IList, 
	ICollection, IEnumerable

The IColumnMappingCollection type exposes the following members.

  NameDescription
Public propertySupported by the XNA FrameworkCountGets the number of elements contained in the ICollection. (Inherited from ICollection.)
Public propertySupported by the XNA FrameworkIsFixedSizeGets a value indicating whether the IList has a fixed size. (Inherited from IList.)
Public propertySupported by the XNA FrameworkIsReadOnlyGets a value indicating whether the IList is read-only. (Inherited from IList.)
Public propertySupported by the XNA FrameworkIsSynchronizedGets a value indicating whether access to the ICollection is synchronized (thread safe). (Inherited from ICollection.)
Public propertySupported by the XNA FrameworkItem[Int32]Gets or sets the element at the specified index. (Inherited from IList.)
Public propertySupported by the XNA FrameworkItem[String]Gets or sets the IColumnMapping object with the specified SourceColumn name.
Public propertySupported by the XNA FrameworkSyncRootGets an object that can be used to synchronize access to the ICollection. (Inherited from ICollection.)
Top
  NameDescription
Public methodSupported by the XNA FrameworkAdd(Object)Adds an item to the IList. (Inherited from IList.)
Public methodSupported by the XNA FrameworkAdd(String, String)Adds a ColumnMapping object to the ColumnMapping collection using the source column and DataSet column names.
Public methodSupported by the XNA FrameworkClearRemoves all items from the IList. (Inherited from IList.)
Public methodSupported by the XNA FrameworkContains(Object)Determines whether the IList contains a specific value. (Inherited from IList.)
Public methodSupported by the XNA FrameworkContains(String)Gets a value indicating whether the DataColumnMappingCollection contains a DataColumnMapping object with the specified source column name.
Public methodSupported by the XNA FrameworkCopyToCopies the elements of the ICollection to an Array, starting at a particular Array index. (Inherited from ICollection.)
Public methodSupported by the XNA FrameworkGetByDataSetColumnGets the ColumnMapping object with the specified DataSet column name.
Public methodSupported by the XNA FrameworkGetEnumeratorReturns an enumerator that iterates through a collection. (Inherited from IEnumerable.)
Public methodSupported by the XNA FrameworkIndexOf(Object)Determines the index of a specific item in the IList. (Inherited from IList.)
Public methodSupported by the XNA FrameworkIndexOf(String)Gets the location of the DataColumnMapping object with the specified source column name. The name is case-sensitive.
Public methodSupported by the XNA FrameworkInsertInserts an item to the IList at the specified index. (Inherited from IList.)
Public methodSupported by the XNA FrameworkRemoveRemoves the first occurrence of a specific object from the IList. (Inherited from IList.)
Public methodSupported by the XNA FrameworkRemoveAt(Int32)Removes the IList item at the specified index. (Inherited from IList.)
Public methodSupported by the XNA FrameworkRemoveAt(String)Removes the IColumnMapping object with the specified SourceColumn name from the collection.
Top
  NameDescription
Public Extension MethodAsParallelEnables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodSupported by the XNA FrameworkCast<TResult>Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodSupported by the XNA FrameworkOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Top

The IColumnMappingCollection interface enables an inheriting class to implement a ColumnMapping collection. For more information, see DataAdapter DataTable and DataColumn Mappings.

An application does not create an instance of the IColumnMappingCollection interface directly, but creates an instance of a class that inherits IColumnMappingCollection.

Classes that inherit IColumnMappingCollection must implement all inherited members, and typically define additional members to add provider-specific functionality. For example, the IColumnMappingCollection interface defines the RemoveAt method. In turn, the DataTableMappingCollection class inherits this method, and defines two additional overloads of RemoveAt.

Notes to Implementers

When you inherit from the IColumnMappingCollection interface, you should implement the following constructor:

Item

Description

ColumnMappingCollection()

Creates an empty ColumnMappingCollection class.

The following example uses an instance of the derived class, DataTableMapping, to Add several DataColumnMapping objects to its ColumnMappings collection, and then displays a list of those mapped source tables. 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());
    }
}

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.