asp.net.ph

DataTableMappingCollection.Add Method ( String, String )

System.Data.Common Namespace   DataTableMappingCollection Class


Adds a table mapping to the collection with the given SourceTable name and DataSetTable name.

[ VB ]
Overloads Public Function Add ( _
   ByVal sourceTable As String, _
   ByVal dataSetTable As String _
) As DataTableMapping

[ C# ]
public DataTableMapping Add (
   string sourceTable,
   string dataSetTable
);

[ C++ ]
public: DataTableMapping* Add (
   String* sourceTable,
   String* dataSetTable
);

[ JScript ]
public function Add (
   sourceTable : String,
   dataSetTable : String
) : DataTableMapping;

Parameters

sourceTable
The case-sensitive name of a SourceTable to map from.
dataSetTable
The case-insensitive name of a DataSetTable to map to.

Return Value

The DataTableMapping object that was added to the collection.

Example

The following example initializes a DataTableMappingCollection, adds DataTableMapping objects to the collection, and displays a list of the mapped source tables.

void CreateTableMappings ( ) {
   DataTableMappingCollection myTables = new DataTableMappingCollection ( );
   myTables.Add ( "Categories", "tblCategories" );
   myTables.Add ( "Products", "tblProducts" );
   myTables.Add ( "Orders", "tblOrders" );
   string myMessage = "Table Mappings:\n";

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

See Also

DataTableMappingCollection Members   DataTableMappingCollection.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