asp.net.ph

DataAdapter.TableMappings Property

System.Data.Common Namespace   DataAdapter Class


Returns a collection of DataTableMapping objects that represent the mapping between a table in the data source and a DataTable in the DataSet.

Syntax


Script [ DataTableMappingCollection variable = ] DataAdapter.TableMappings

Return Value

A DataTableMappingCollection object that provides the master mapping between tables in a data source and DataTable objects in a DataSet.

This property is read-only with no default value.

Remarks

The TableMappings property is used to retrieve the collection of DataTableMapping objects, each of which represents the mapping between a table in the data source and a linked DataTable within a DataSet.

When reconciling changes, the DataAdapter uses the DataTableMappingCollection to associate the column names used by the data source with the column names used by the DataSet.

Example

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

void getTableMappings ( DataAdapter myAdapter ) {
   // get table mappings
   DataTableMappingCollection myTables = myAdapter.TableMappings;
   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

DataAdapter Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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