asp.net.ph

DataColumnMappingCollection.Add Method

System.Data.Common Namespace   DataColumnMappingCollection Class


Adds a column mapping to the collection.

Overload List

1. Adds a column mapping object to the collection.

2. Adds a column mapping to the collection with the given SourceColumn name and DataSetColumn name.


Example

The following example initializes a DataColumnMappingCollection, adds DataColumnMapping objects to the collection, and displays a list of the mapped source columns.

NOTE: This example uses one of the overloaded versions of Add. For other examples that may be available, see the individual overload topics.

void CreateColumnMappings ( ) {
   DataColumnMappingCollection myFieldsMaps = new DataColumnMappingCollection ( );
   myFieldsMaps.Add ( "Category Name", "DataCategory" );
   myFieldsMaps.Add ( "Description", "DataDescription" );
   myFieldsMaps.Add ( "Picture", "DataPicture" );
   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

DataColumnMappingCollection Members   AddRange   Remove   RemoveAt   Clear 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