Name

DataTableMapping

Synopsis

This class represents a mapping between a table name in the data source (SourceTable) and the table name in the System.Data.DataSet (DataSetTable). The data source table name is case-sensitive, while the System.Data.DataSet table name isn’t. A third property, DataColumnMappingCollection, contains all field-name mappings for the table. Column and table name mappings aren’t required (by default, ADO.NET simply uses the data source names), but they do add that an extra layer of indirection.

Table mappings are applied to the DataAdapter. Table mappings work in both directions: when filling a table and when updating it. You add a table mapping to a DataAdapter by inserting the appropriate DataTableMapping into the DataAdapter.TableMappings collection.

public sealed class DataTableMapping : MarshalByRefObject, System.Data.ITableMapping, ICloneable {

// Public Constructors

   public DataTableMapping( );  

   public DataTableMapping(string sourceTable, string dataSetTable);

   public DataTableMapping(string sourceTable, string dataSetTable, DataColumnMapping[  ] columnMappings);

// Public Instance Properties

   public DataColumnMappingCollection ColumnMappings{get; } 

   public string DataSetTable{set; get; }          // implements System.Data.ITableMapping

   public string SourceTable{set; get; }             // implements System.Data.ITableMapping

                  // Public Instance Methods

   public DataColumnMapping GetColumnMappingBySchemaAction(string sourceColumn,

        System.Data.MissingMappingAction mappingAction); public ...

Get ADO.NET in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.