| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- //
- // System.Data.Common.DataTableMapping.cs
- //
- // Author:
- // Rodrigo Moya ([email protected])
- //
- // (C) Ximian, Inc
- //
- using System.Data;
- namespace System.Data.Common
- {
- /// <summary>
- /// Contains a description of a mapped relationship between a source table and a DataTable. This class is used by a DataAdapter when populating a DataSet.
- /// </summary>
- public sealed class DataTableMapping : MarshalByRefObject, ITableMapping, ICloneable
- {
- #region Fields
- string sourceTable;
- string dataSetTable;
- DataColumnMappingCollection columnMappings;
- #endregion
- #region Constructors
- public DataTableMapping ()
- {
- dataSetTable = String.Empty;
- sourceTable = String.Empty;
- columnMappings = new DataColumnMappingCollection ();
- }
- public DataTableMapping (string sourceTable, string dataSetTable)
- : this ()
- {
- this.sourceTable = sourceTable;
- this.dataSetTable = dataSetTable;
- }
-
- public DataTableMapping (string sourceTable, string dataSetTable, DataColumnMapping[] columnMappings)
- : this (sourceTable, dataSetTable)
- {
- this.columnMappings.AddRange (columnMappings);
- }
- #endregion
- #region Properties
- public DataColumnMappingCollection ColumnMappings {
- get { return columnMappings; }
- }
- public string DataSetTable {
- get { return dataSetTable; }
- set { dataSetTable = value; }
- }
- public string SourceTable {
- get { return sourceTable; }
- set { sourceTable = value; }
- }
- IColumnMappingCollection ITableMapping.ColumnMappings {
- get { return ColumnMappings; }
- }
-
- #endregion
- #region Methods
- public DataColumnMapping GetColumnMappingBySchemaAction (string sourceColumn, MissingMappingAction mappingAction)
- {
- return DataColumnMappingCollection.GetColumnMappingBySchemaAction (columnMappings, sourceColumn, mappingAction);
- }
- [MonoTODO]
- public DataTable GetDataTableBySchemaAction (DataSet dataSet, MissingSchemaAction schemaAction)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- object ICloneable.Clone ()
- {
- throw new NotImplementedException ();
- }
- public override string ToString ()
- {
- return SourceTable;
- }
-
- #endregion
- }
- }
|