System.Data.OleDb.OleDbDataAdapter Class

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

See Also: OleDbDataAdapter Members

Syntax

[System.ComponentModel.ToolboxItem("Microsoft.VSDesigner.Data.VS.OleDbDataAdapterToolboxItem, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Designer("Microsoft.VSDesigner.Data.VS.OleDbDataAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.DefaultEvent("RowUpdated")]
public sealed class OleDbDataAdapter : System.Data.Common.DbDataAdapter

Remarks

The System.Data.OleDb.OleDbDataAdapter serves as a bridge between a System.Data.DataSet and data source for retrieving and saving data. The System.Data.OleDb.OleDbDataAdapter provides this bridge by using System.Data.Common.DbDataAdapter.Fill(System.Data.DataSet) to load data from the data source into the System.Data.DataSet, and using System.Data.Common.DbDataAdapter.Update(System.Data.DataSet) to send changes made in the System.Data.DataSet back to the data source.

When the System.Data.OleDb.OleDbDataAdapter fills a System.Data.DataSet, it will create the appropriate tables and columns for the returned data if they do not already exist. However, primary key information is not included in the implicitly created schema unless the System.Data.Common.DataAdapter.MissingSchemaAction property is set to System.Data.MissingSchemaAction.AddWithKey. You may also have the System.Data.OleDb.OleDbDataAdapter create the schema of the System.Data.DataSet, including primary key information, before filling it with data using System.Data.Common.DbDataAdapter.FillSchema(System.Data.DataTable, System.Data.SchemaType). For more information, see Adding Existing Constraints to a DataSet.

Note that some OLE DB providers, including the MSDataShape provider, do not return base table or primary key information. Therefore, the System.Data.OleDb.OleDbDataAdapter cannot correctly set the System.Data.DataTable.PrimaryKey property on any created System.Data.DataTable. In these cases you should explicitly specify primary keys for tables in the System.Data.DataSet.

The System.Data.OleDb.OleDbDataAdapter also includes the OleDbDataAdapter.SelectCommand, OleDbDataAdapter.InsertCommand, OleDbDataAdapter.DeleteCommand, OleDbDataAdapter.UpdateCommand, and System.Data.Common.DataAdapter.TableMappings properties to facilitate the loading and updating of data.

When you create an instance of System.Data.OleDb.OleDbDataAdapter, properties are set to their initial values. For a list of these values, see the System.Data.OleDb.OleDbDataAdapter constructor.

Requirements

Namespace: System.Data.OleDb
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0