2 // System.Data.Common.DataAdapter
5 // Rodrigo Moya (rodrigo@ximian.com)
10 using System.ComponentModel;
13 namespace System.Data.Common
16 /// Represents a set of data commands and a database connection that are used to fill the DataSet and update the data source.
18 public abstract class DataAdapter : Component, IDataAdapter
20 private bool acceptChangesDuringFill;
21 private bool continueUpdateOnError;
22 private MissingMappingAction missingMappingAction;
23 private MissingSchemaAction missingSchemaAction;
24 private DataTableMappingCollection tableMappings;
26 protected DataAdapter () {
27 acceptChangesDuringFill = false;
28 continueUpdateOnError = false;
29 missingMappingAction = MissingMappingAction.Error;
30 missingSchemaAction = MissingSchemaAction.Error;
34 public abstract int Fill (DataSet dataSet);
36 public abstract DataTable[] FillSchema (DataSet dataSet,
37 SchemaType schemaType);
39 public abstract IDataParameter[] GetFillParameters ();
41 public abstract int Update (DataSet dataSet);
43 protected virtual DataAdapter CloneInternals () {
46 protected virtual DataTableMappingCollection CreateTableMappings () {
49 protected virtual bool ShouldSerializeTableMappings () {
52 public bool AcceptChangesDuringFill {
54 return acceptChangesDuringFill;
57 acceptChangesDuringFill = value;
61 public bool ContinueUpdateOnError {
63 return continueUpdateOnError;
66 continueUpdateOnError = value;
70 public MissingMappingAction MissingMappingAction {
72 return missingMappingAction;
75 missingMappingAction = value;
79 public MissingSchemaAction MissingSchemaAction {
81 return missingSchemaAction;
84 missingSchemaAction = value;
88 public DataTableMappingCollection TableMappings {
90 if (tableMappings == null)
91 tableMappings = CreateTableMappings ();