asp.net.ph

IColumnMappingCollection Interface

System.Data Namespace


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

IColumnMappingCollection Interface Members

Collapse   Properties

Visibility Name Value Type Accessibility
public Item ( String index ) Object [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
public Add ( String sourceColumnName , String dataSetColumnName ) IColumnMapping
public Contains ( String sourceColumnName ) Boolean
public GetByDataSetColumn ( String dataSetColumnName ) IColumnMapping
public IndexOf ( String sourceColumnName ) Int32
public RemoveAt ( String sourceColumnName ) Void

Classes that Implement IColumnMappingCollection


Class Description
DataColumnMappingCollection Contains a collection of DataColumnMapping objects. This class cannot be inherited.

Remarks

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

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

Classes that inherit IColumnMappingCollection must implement the inherited members, and typically define additional members to add provider-specific functionality. For example, the IColumnMappingCollection interface defines one implementation of 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
PrvColumnMappingCollection ( ) Initializes an empty PrvColumnMappingCollection class.

Example

The following example uses an instance of the derived class, DataTableMapping, to Add DataColumnMapping objects to its ColumnMappings collection and displays a list of those mapped source tables. This example assumes that a DataTableMapping has already been created.

void ShowColumnMappings ( ) {

   // ... create myTableMap ...
   myTableMap.ColumnMappings.Add ( "Category Name", "DataCategory" );
   myTableMap.ColumnMappings.Add ( "Description","DataDescription" );
   myTableMap.ColumnMappings.Add ( "Picture","DataPicture" );
   string myMessage = "Column Mappings:\n";
   for ( int i = 0;i < myTableMap.ColumnMappings.Count; i++ ) {
      myMessage + =  i.ToString ( ) + " " +
         myTableMap.ColumnMappings [ ].ToString ( ) + "<br>";
  }
   Response.Write ( myMessage );
}
  C# VB

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph