The OpenAccessCommandBuilder object automatically generates single-table SQL commands that are used to reconcile changes made to a DataSet with the OpenAccess SDK server. An OpenAccessCommandBuilder object is always associated with an OpenAccessDataAdapter object.
Using a CommandBuilder object can have a negative effect on performance. Because of concurrency restrictions, the CommandBuilder does not generate efficient SQL statements. The end-user can often write more efficient update and delete statements than those that the CommandBuilder generates. In addition, the CommandBuilder object registers itself as a listener for the RowUpdating and RowUpdated events of its DataAdapter object. This means that two events must be processed for every row that is updated.
In addition to the public properties of the CommandBuilder object, the OpenAccessCommandBuilder object supports the following property. For information about other properties and methods supported, refer to the data provider’s online help and the Microsoft .NET Framework SDK documentation.
Table 33: Properties of the OpenAccessCommandBuilder Object
Property
Description
AllowUpdateWithoutKey
Allows the use of the OpenAccessCommandBuilder on a table that has no primary key or unique index.
When set to True, a DataAdapter.Update can succeed when a single SQL statement updates multiple rows in the underlying table. Normally, each Update or Delete statement executed on a DataAdapter.Update changes only one row.