DataAdapter Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a set of SQL commands and a database connection that are used to fill the DataSet and update the data source.
public ref class DataAdapter : System::ComponentModel::Component, System::Data::IDataAdapter
public ref class DataAdapter abstract : System::ComponentModel::Component, System::Data::IDataAdapter
public class DataAdapter : System.ComponentModel.Component, System.Data.IDataAdapter
public abstract class DataAdapter : System.ComponentModel.Component, System.Data.IDataAdapter
type DataAdapter = class
inherit Component
interface IDataAdapter
Public Class DataAdapter
Inherits Component
Implements IDataAdapter
Public MustInherit Class DataAdapter
Inherits Component
Implements IDataAdapter
- Inheritance
- Derived
- Implements
The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet.
If you are connecting to a SQL Server database, you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection objects. For OLE DB-supported data sources, use the DataAdapter with its associated OleDbCommand and OleDbConnection objects. For ODBC-supported data sources, use the DataAdapter with its associated OdbcCommand and OdbcConnection objects. For Oracle databases, use the DataAdapter with its associated OracleCommand and OracleConnection objects.
When an instance of DataAdapter is created, the read/write properties are set to initial values. For a list of these values, see the DataAdapter constructor.
Data |
Initializes a new instance of the DataAdapter class. |
Data |
Initializes a new instance of the DataAdapter class from an existing object of the same type. |
Accept |
Gets or sets a value indicating whether AcceptChanges() is called on a DataRow after it is added to the DataTable during any of the Fill operations. |
Accept |
Gets or sets whether AcceptChanges() is called during a Update(DataSet). |
Can |
Gets a value indicating whether the component can raise an event. (Inherited from Component) |
Container |
Gets the IContainer that contains the Component. (Inherited from Component) |
Continue |
Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update. |
Design |
Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component) |
Events |
Gets the list of event handlers that are attached to this Component. (Inherited from Component) |
Fill |
Gets or sets the LoadOption that determines how the adapter fills the DataTable from the DbDataReader. |
Missing |
Determines the action to take when incoming data does not have a matching table or column. |
Missing |
Determines the action to take when existing DataSet schema does not match incoming data. |
Return |
Gets or sets whether the |
Site |
Gets or sets the ISite of the Component. (Inherited from Component) |
Table |
Gets a collection that provides the primary mapping between a source table and a DataTable. |
Clone |
Obsolete.
Obsolete.
Obsolete.
Obsolete.
Creates a copy of this instance of DataAdapter. |
Create |
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject) |
Create |
Creates a new DataTableMappingCollection. |
Dispose() |
Releases all resources used by the Component. (Inherited from Component) |
Dispose(Boolean) |
Releases the unmanaged resources used by the DataAdapter and optionally releases the managed resources. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Fill(Data |
Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names. |
Fill(Data |
Adds or refreshes rows in the DataSet to match those in the data source. |
Fill(Data |
Adds or refreshes rows in the DataTable to match those in the data source using the DataTable name and the specified IDataReader. |
Fill(Data |
Adds or refreshes rows in a specified range in the collection of DataTable objects to match those in the data source. |
Fill |
|
Fill |
Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType. |
Fill |
|
Get |
Gets the parameters set by the user when executing an SQL SELECT statement. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Obsolete.
Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject) |
Get |
Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component) |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Has |
Indicates whether a DataTableMappingCollection has been created. |
Initialize |
Obsolete.
Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject) |
On |
Invoked when an error occurs during a |
Reset |
Resets FillLoadOption to its default state and causes Fill(DataSet) to honor AcceptChangesDuringFill. |
Should |
Determines whether the AcceptChangesDuringFill property should be persisted. |
Should |
Determines whether the FillLoadOption property should be persisted. |
Should |
Determines whether one or more DataTableMapping objects exist and they should be persisted. |
To |
Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component) |
Update(Data |
Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet from a DataTable named "Table." |
Disposed |
Occurs when the component is disposed by a call to the Dispose() method. (Inherited from Component) |
Fill |
Returned when an error occurs during a fill operation. |
IData |
Gets a collection that indicates how a source table is mapped to a dataset table. |
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: