IColumnMappingCollection IColumnMappingCollection IColumnMappingCollection IColumnMappingCollection Interface


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

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


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");
    Console.WriteLine("Column Mappings");
    for(int i=0;i < tableMapping.ColumnMappings.Count;i++) 
        Console.WriteLine("  {0} {1}", i,
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, _
    Next i
End Sub


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.


Count Count Count Count

Gets the number of elements contained in the ICollection.

(Inherited from ICollection)
IsFixedSize IsFixedSize IsFixedSize IsFixedSize

Gets a value indicating whether the IList has a fixed size.

(Inherited from IList)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value indicating whether the IList is read-only.

(Inherited from IList)
IsSynchronized IsSynchronized IsSynchronized IsSynchronized

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]

Gets or sets the IColumnMapping object with the specified SourceColumn name.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets an object that can be used to synchronize access to the ICollection.

(Inherited from ICollection)


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

Adds an item to the IList.

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

Adds a ColumnMapping object to the ColumnMapping collection using the source column and DataSet column names.

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

Removes all items from the IList.

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

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 DataColumnMappingCollection contains a DataColumnMapping object with the specified source column name.

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

Copies the elements of the ICollection to an Array, starting at a particular Array index.

(Inherited from ICollection)
GetByDataSetColumn(String) GetByDataSetColumn(String) GetByDataSetColumn(String) GetByDataSetColumn(String)

Gets the ColumnMapping object with the specified DataSet column name.

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

Returns an enumerator that iterates through a collection.

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

Determines the index of a specific item in the IList.

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

Gets the location of the DataColumnMapping object with the specified source column name. The name is case-sensitive.

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

Inserts an item to the IList at the specified index.

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

Removes the first occurrence of a specific object from the IList.

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

Removes the IList item at the specified index.

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

Removes the IColumnMapping object with the specified SourceColumn name from the collection.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(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)

Converts an IEnumerable to an IQueryable.

Applies to