asp.net.ph

DataColumnMappingCollection Class

System.Data.Common Namespace


Represents a collection of column mappings for a DataTableMapping object.

DataColumnMappingCollection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public DataColumnMappingCollection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public Count Int32 [ Get ]
public Item ( String sourceColumn ) DataColumnMapping [ Get , Set ]
public Item ( Int32 index ) DataColumnMapping [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
public Add ( String sourceColumn , String dataSetColumn ) DataColumnMapping
public Add ( Object value ) Int32
public AddRange ( Array values ) Void
public AddRange ( DataColumnMapping values ) Void
public Clear ( ) Void
public Contains ( Object value ) Boolean
public Contains ( String value ) Boolean
public CopyTo ( DataColumnMapping array , Int32 index ) Void
public CopyTo ( Array array , Int32 index ) Void
public GetByDataSetColumn ( String value ) DataColumnMapping
public static GetColumnMappingBySchemaAction ( DataColumnMappingCollection columnMappings , String sourceColumn , MissingMappingAction mappingAction ) DataColumnMapping
public static GetDataColumn ( DataColumnMappingCollection columnMappings , String sourceColumn , Type dataType , DataTable dataTable , MissingMappingAction mappingAction , MissingSchemaAction schemaAction ) DataColumn
public GetEnumerator ( ) IEnumerator
public IndexOf ( Object value ) Int32
public IndexOf ( String sourceColumn ) Int32
public IndexOfDataSetColumn ( String dataSetColumn ) Int32
public Insert ( Int32 index , Object value ) Void
public Insert ( Int32 index , DataColumnMapping value ) Void
public Remove ( DataColumnMapping value ) Void
public Remove ( Object value ) Void
public RemoveAt ( Int32 index ) Void
public RemoveAt ( String sourceColumn ) Void

Remarks

The DataColumnMappingCollection contains the collection of DataColumnMapping objects that link the table columns in a DataSet to those in a data source. This collection is accessed via the DataTableMapping.ColumnMappings property.

Like most data collections in ADO.NET, the DataColumnMappingCollection uses standard collection methods to manage the items in the collection. These include the methods Add, Clear, and Remove.

The collection also includes a Count property to determine how many DataColumn objects are in the collection, and a Contains method to verify whether a specified column mapping exists in the collection.

Example

The following example demonstrates using the ColumnMappings property to print the values of each DataColumnMapping object in the collection.

void getColumnMappings ( DataTableMapping myTableMap ) {
   // get column mappings
   DataColumnMappingCollection myFieldsMaps = myTableMap.ColumnMappings;
   string myMessage = "Column Mappings:\n";

   for ( int i=0; i < myFieldsMaps.Count; i++ ) {
      myMessage += i.ToString ( ) + " " + myFieldsMaps [ ].ToString ( ) + "\n";
   }
   Response.Write ( myMessage );
}
  C# VB

See Also

ColumnMappings   DataColumnMapping 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