Export (0) Print
Expand All

DataAdapter Class

Represents a set of SQL commands and a database connection that are used to fill the DataSet and update the data source.

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)

public class DataAdapter : Component, 
	IDataAdapter

The DataAdapter type exposes the following members.

  NameDescription
Protected methodSupported by the XNA FrameworkDataAdapter()Initializes a new instance of a DataAdapter class.
Protected methodSupported by the XNA FrameworkDataAdapter(DataAdapter)Initializes a new instance of a DataAdapter class from an existing object of the same type.
Top

  NameDescription
Public propertySupported by the XNA FrameworkAcceptChangesDuringFillGets 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.
Public propertySupported by the XNA FrameworkAcceptChangesDuringUpdateGets or sets whether AcceptChanges is called during a Update.
Protected propertyCanRaiseEventsGets a value indicating whether the component can raise an event. (Inherited from Component.)
Public propertyContainerGets the IContainer that contains the Component. (Inherited from Component.)
Public propertySupported by the XNA FrameworkContinueUpdateOnErrorGets or sets a value that specifies whether to generate an exception when an error is encountered during a row update.
Protected propertyDesignModeGets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)
Protected propertySupported by the XNA FrameworkEventsGets the list of event handlers that are attached to this Component. (Inherited from Component.)
Public propertySupported by the XNA FrameworkFillLoadOptionGets or sets the LoadOption that determines how the adapter fills the DataTable from the DbDataReader.
Public propertySupported by the XNA FrameworkMissingMappingActionDetermines the action to take when incoming data does not have a matching table or column.
Public propertySupported by the XNA FrameworkMissingSchemaActionDetermines the action to take when existing DataSet schema does not match incoming data.
Public propertySupported by the XNA FrameworkReturnProviderSpecificTypesGets or sets whether the Fill method should return provider-specific values or common CLS-compliant values.
Public propertySupported by the XNA FrameworkSiteGets or sets the ISite of the Component. (Inherited from Component.)
Public propertySupported by the XNA FrameworkTableMappingsGets a collection that provides the master mapping between a source table and a DataTable.
Top

  NameDescription
Protected methodSupported by the XNA FrameworkCloneInternals Obsolete. Creates a copy of this instance of DataAdapter.
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Protected methodSupported by the XNA FrameworkCreateTableMappingsCreates a new DataTableMappingCollection.
Public methodSupported by the XNA FrameworkDispose()Releases all resources used by the Component. (Inherited from Component.)
Protected methodSupported by the XNA FrameworkDispose(Boolean)Releases the unmanaged resources used by the DataAdapter and optionally releases the managed resources. (Overrides Component.Dispose(Boolean).)
Public methodSupported by the XNA FrameworkEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodSupported by the XNA FrameworkFill(DataSet)Adds or refreshes rows in the DataSet to match those in the data source.
Protected methodSupported by the XNA FrameworkFill(DataTable, IDataReader)Adds or refreshes rows in the DataTable to match those in the data source using the DataTable name and the specified IDataReader.
Protected methodSupported by the XNA FrameworkFill(DataTable[], IDataReader, Int32, Int32)Adds or refreshes rows in a specified range in the collection of DataTable objects to match those in the data source.
Protected methodSupported by the XNA FrameworkFill(DataSet, String, IDataReader, Int32, Int32)Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.
Public methodSupported by the XNA FrameworkFillSchema(DataSet, SchemaType)Adds a DataTable to the specified DataSet and configures the schema to match that in the data source based on the specified SchemaType.
Protected methodSupported by the XNA FrameworkFillSchema(DataTable, SchemaType, IDataReader)Adds a DataTable to the specified DataSet.
Protected methodSupported by the XNA FrameworkFillSchema(DataSet, SchemaType, String, IDataReader)Adds a DataTable to the specified DataSet.
Protected methodSupported by the XNA FrameworkFinalizeReleases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)
Public methodSupported by the XNA FrameworkGetFillParametersGets the parameters set by the user when executing an SQL SELECT statement.
Public methodSupported by the XNA FrameworkGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodGetServiceReturns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)
Public methodSupported by the XNA FrameworkGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by the XNA FrameworkHasTableMappingsIndicates whether a DataTableMappingCollection has been created.
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodSupported by the XNA FrameworkMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Protected methodSupported by the XNA FrameworkOnFillErrorInvoked when an error occurs during a Fill.
Public methodSupported by the XNA FrameworkResetFillLoadOptionResets FillLoadOption to its default state and causes DataAdapter.Fill to honor AcceptChangesDuringFill.
Public methodSupported by the XNA FrameworkShouldSerializeAcceptChangesDuringFillDetermines whether the AcceptChangesDuringFill property should be persisted.
Public methodSupported by the XNA FrameworkShouldSerializeFillLoadOptionDetermines whether the FillLoadOption property should be persisted.
Protected methodSupported by the XNA FrameworkShouldSerializeTableMappingsDetermines whether one or more DataTableMapping objects exist and they should be persisted.
Public methodSupported by the XNA FrameworkToStringReturns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)

In XNA Framework 3.0, this member is inherited from Object.ToString().
Public methodSupported by the XNA FrameworkUpdateCalls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified DataSet from a DataTable named "Table."
Top

  NameDescription
Public eventSupported by the XNA FrameworkDisposedOccurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)
Public eventSupported by the XNA FrameworkFillErrorReturned when an error occurs during a fill operation.
Top

  NameDescription
Explicit interface implemetationPrivate propertySupported by the XNA FrameworkIDataAdapter.TableMappingsIndicates how a source table is mapped to a dataset table.
Top

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft