asp.net.ph

DataColumnMappingCollection.Add Method ( String, String )

System.Data.Common Namespace   DataColumnMappingCollection Class


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

[ VB ]
Overloads Public Function Add ( _
   ByVal sourceColumn As String, _
   ByVal dataSetColumn As String _
) As DataColumnMapping

[ C# ]
public DataColumnMapping Add (
   string sourceColumn,
   string dataSetColumn
);

[ C++ ]
public: DataColumnMapping* Add (
   String* sourceColumn,
   String* dataSetColumn
);

[ JScript ]
public function Add (
   sourceColumn : String,
   dataSetColumn : String
) : DataColumnMapping;

Parameters

sourceColumn
The case-sensitive name of a SourceColumn to map from.
dataSetColumn
The case-insensitive name of a DataSetColumn to map to.

Return Value

The DataColumnMapping object that was added to the collection.

Example

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

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   DataColumnMappingCollection.Add Overload List 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