PsqlCommandBuilder Object
Show this topic in Library frames
The PsqlCommandBuilder object automatically generates single-table SQL commands that are used to reconcile changes made to a DataSet with the Pervasive.SQL database. An PsqlCommandBuilder object is always associated with an PsqlDataAdapter 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.
Table 4-3 describes the public properties supported by the PsqlCommandBuilder object.
Table 4-3 Public Properties of the PsqlCommandBuilder Object
|
Property
|
Description
|
|
AllowUpdateWithoutKey
|
Allows the use of the PsqlCommandBuilder on a table that has no primary key or unique index. Use this option only with great care.
Setting this property to true can cause a PsqlDataAdapter.Update to succeed when multiple rows are updated with a single SQL statement. Normally, each Update or Delete statement executed on a PsqlDataAdapter.Update changes only one row in the underlying table.
The initial default is false.
|
|
DataAdapter
|
Gets or sets the PsqlDataAdapter object associated with this PsqlCommandBuilder.
|
|
QuotePrefix
|
Gets or sets the beginning character or characters to use when working with database objects (for example, tables or columns) that have names containing spaces or reserved tokens or other special characters.
|
|
QuoteSuffix
|
Gets or sets the ending character or characters to use when working with database objects (for example, tables or columns) that have names containing spaces or reserved tokens or other special characters.
|
Table 4-4 provides the public methods supported for the PsqlCommandBuilder object.
Table 4-4 Public Methods of the PsqlCommandBuilder Object
|
Property
|
Description
|
|
DeriveParameters
|
Populates the specified PsqlCommand object's Parameters collection with parameter information for a stored procedure specified in the PsqlCommand.
|
|
GetDeleteCommand
|
Gets the automatically generated PsqlCommand object required to perform deletions on the database when an application calls Update on the PsqlDataAdapter.
|
|
GetInsertCommand
|
Gets the automatically generated PsqlCommand object required to perform inserts on the database when an application calls Update on the PsqlDataAdapter.
|
|
GetUpdateCommand
|
Gets the automatically generated PsqlCommand object required to perform updates on the database when an application calls Update on the PsqlDataAdapter.
|
|
RefreshSchema
|
Refreshes the database schema information that is used to generate INSERT, UPDATE, or DELETE statements.
|