2 // System.Data.Common.DataAdapter
5 // Rodrigo Moya (rodrigo@ximian.com)
12 namespace System.Data.Common
15 /// Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
17 public abstract class DataAdapter : Component, IDataAdapter
19 private bool acceptChangesDuringFill;
20 private bool continueUpdateOnError;
21 private MissingMappingAction missingMappingAction;
22 private MissingSchemaAction missingSchemaAction;
23 private DataTableMappingCollection tableMappings;
25 protected DataAdapter () {
26 acceptChangesDuringFill = false;
27 continueUpdateOnError = false;
28 missingMappingAction = MissingMappingAction.Error;
29 missingSchemaAction = MissingSchemaAction.Error;
33 public abstract int Fill (DataSet dataSet);
35 public abstract DataTable[] FillSchema (DataSet dataSet,
36 SchemaType schemaType);
38 public abstract IDataParameter[] GetFillParameters ();
40 public abstract int Update (DataSet dataSet);
42 protected virtual DataAdapter CloneInternals () {
45 protected virtual DataTableMappingCollection CreateTableMappings () {
48 protected virtual bool ShouldSerializeTableMappings () {
51 public bool AcceptChangesDuringFill {
53 return acceptChangesDuringFill;
56 acceptChangesDuringFill = value;
60 public bool ContinueUpdateOnError {
62 return continueUpdateOnError;
65 continueUpdateOnError = value;
69 public MissingMappingAction MissingMappingAction {
71 return missingMappingAction;
74 missingMappingAction = value;
78 public MissingSchemaAction MissingSchemaAction {
80 return missingSchemaAction;
83 missingSchemaAction = value;
87 public DataTableMappingCollection TableMappings {
89 if (tableMappings == null)
90 tableMappings = CreateTableMappings ();