Home

OleDbDataAdapter

OleDbDataAdapter is a data adapter in the .NET Framework and .NET, located in the System.Data.OleDb namespace. It enables data transfer between a DataSet or DataTable and a data source that is exposed through the OLE DB interface.

The adapter uses OleDbCommand objects for the four CRUD commands: SelectCommand, InsertCommand, UpdateCommand, and DeleteCommand. It

Key features include command properties (SelectCommand, InsertCommand, UpdateCommand, DeleteCommand), DataTable mappings via TableMappings, and options such

If you set only a SelectCommand, you can use an OleDbCommandBuilder to auto-generate the remaining commands,

Typical usage involves creating an OleDbConnection, initializing an OleDbDataAdapter with a SELECT command, filling a DataSet,

OleDbDataAdapter works with a variety of OLE DB providers, including Access, SQL Server via OLE DB, and

can
fill
a
DataSet
or
DataTable
with
the
results
of
a
query
by
calling
Fill,
and
can
save
changes
back
to
the
data
source
by
calling
Update,
which
applies
added,
modified,
and
deleted
rows.
as
MissingSchemaAction
and
MissingMappingAction.
The
adapter
also
exposes
events
such
as
RowUpdating
and
RowUpdated
to
customize
behavior
during
data
transfer.
The
UpdateBatchSize
property
may
be
used
to
control
batch
updates
when
supported
by
the
provider.
provided
the
query
returns
a
primary
key.
making
changes
to
the
DataSet,
and
calling
Update
to
persist
those
changes
back
to
the
data
source.
others.
It
is
suitable
for
disconnected
data
scenarios
and
remains
a
common
component
in
legacy
and
some
cross-provider
data
access
code.