O'Reilly logo

Visual Basic 2012 Programmer's Reference by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DATA ADAPTERS

A data adapter transfers data between a connection and a DataSet. This object’s most important methods are Fill and Update, which move data from and to the database, respectively. A data adapter also provides properties and other methods that can be useful. The following table describes the object’s most useful properties.

PROPERTY PURPOSE
DeleteCommand The command object that the adapter uses to delete rows.
InsertCommand The command object that the adapter uses to insert rows.
SelectCommand The command object that the adapter uses to select rows.
TableMappings A collection of DataTableMapping objects that determine how tables in the database are mapped to tables in the DataSet. Each DataTableMapping object has a ColumnMappings collection that determines how the columns in the database table are mapped to columns in the DataSet table.
UpdateCommand The command object that the adapter uses to update rows.

You can create the command objects in a couple of ways. For example, if you use the Data Adapter Configuration Wizard (described shortly) to build the adapter at design time, the wizard automatically creates these objects. You can select the adapter and expand these objects in the Properties window to read their properties, including the CommandText property that defines the commands.

Another way to create these commands is to use a command builder object. If you attach a command builder to a data adapter, the adapter uses the command builder to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required