DataColumnMappingCollection Class
Contains a collection of DataColumnMapping objects.
Namespace: System.Data.Common
Assembly: System.Data (in System.Data.dll)
The DataColumnMappingCollection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | Count | Gets the number of DataColumnMapping objects in the collection. |
![]() ![]() | Item[Int32] | Gets or sets the DataColumnMapping object at the specified index. |
![]() ![]() | Item[String] | Gets or sets the DataColumnMapping object with the specified source column name. |
| Name | Description | |
|---|---|---|
![]() ![]() | Add(Object) | Adds a DataColumnMapping object to the collection. |
![]() ![]() | Add(String, String) | Adds a DataColumnMapping object to the collection when given a source column name and a DataSet column name. |
![]() ![]() | AddRange(Array) | Copies the elements of the specified Array to the end of the collection. |
![]() ![]() | AddRange(DataColumnMapping[]) | Copies the elements of the specified DataColumnMapping array to the end of the collection. |
![]() ![]() | Clear | Removes all DataColumnMapping objects from the collection. |
![]() ![]() | Contains(Object) | Gets a value indicating whether a DataColumnMapping object with the given Object exists in the collection. |
![]() ![]() | Contains(String) | Gets a value indicating whether a DataColumnMapping object with the given source column name exists in the collection. |
![]() ![]() | CopyTo(Array, Int32) | Copies the elements of the DataColumnMappingCollection to the specified array. |
![]() ![]() | CopyTo(DataColumnMapping[], Int32) | Copies the elements of the DataColumnMappingCollection to the specified DataColumnMapping array. |
![]() | 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.) |
![]() ![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() ![]() | GetByDataSetColumn | Gets the DataColumnMapping object with the specified DataSet column name. |
![]() ![]() ![]() | GetColumnMappingBySchemaAction | Gets a DataColumnMapping for the specified DataColumnMappingCollection, source column name, and MissingMappingAction. |
![]() ![]() ![]() | GetDataColumn | A static method that returns a DataColumn object without instantiating a DataColumnMappingCollection object. |
![]() ![]() | GetEnumerator | Gets an enumerator that can iterate through the collection. |
![]() ![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() ![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | IndexOf(Object) | Gets the location of the specified Object that is a DataColumnMapping within the collection. |
![]() ![]() | IndexOf(String) | Gets the location of the DataColumnMapping with the specified source column name. |
![]() ![]() | IndexOfDataSetColumn | Gets the location of the specified DataColumnMapping with the given DataSet column name. |
![]() | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() ![]() | Insert(Int32, DataColumnMapping) | Inserts a DataColumnMapping object into the DataColumnMappingCollection at the specified index. |
![]() ![]() | Insert(Int32, Object) | Inserts a DataColumnMapping object into the DataColumnMappingCollection at the specified index. |
![]() ![]() | Remove(DataColumnMapping) | Removes the specified DataColumnMapping from the collection. |
![]() ![]() | Remove(Object) | Removes the Object that is a DataColumnMapping from the collection. |
![]() ![]() | RemoveAt(Int32) | Removes the DataColumnMapping object with the specified index from the collection. |
![]() ![]() | RemoveAt(String) | Removes the DataColumnMapping object with the specified source column name from the collection. |
![]() ![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AsParallel | Enables parallelization of a query. (Defined by ParallelEnumerable.) |
![]() | AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) |
![]() ![]() | Cast<TResult> | Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) |
![]() ![]() | OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
| Name | Description | |
|---|---|---|
![]() ![]() ![]() | ICollection.IsSynchronized | Gets a value that indicates whether access to the ICollection is synchronized (thread safe). |
![]() ![]() ![]() | ICollection.SyncRoot | Gets an object that can be used to synchronize access to the ICollection. |
![]() ![]() ![]() | IColumnMappingCollection.Add | Adds a DataColumnMapping object to the DataColumnMappingCollection by using the source column and DataSet column names. |
![]() ![]() ![]() | IColumnMappingCollection.GetByDataSetColumn | Gets the DataColumnMapping object that has the specified DataSet column name. |
![]() ![]() ![]() | IColumnMappingCollection.Item | Gets or sets the IColumnMapping object with the specified SourceColumn name. |
![]() ![]() ![]() | IList.IsFixedSize | Gets a value that indicates whether the IList has a fixed size. |
![]() ![]() ![]() | IList.IsReadOnly | Gets a value that indicates whether the IList is read-only. |
![]() ![]() ![]() | IList.Item | Gets or sets the element at the specified index. |
The following example uses a DataTableMapping to Add several DataColumnMapping objects to its ColumnMappings collection, and then displays a list of those mapped source columns. 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()); } }
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.

