Send feedback on this topic.
Teradata.Client.Provider
TdCommandBuilder and TdDataAdapter Overview
.NET Data Provider for Teradata > Developer's Guide > Working with the Data Provider Features > TdCommandBuilder and TdDataAdapter Overview

The TdDataAdapter provides a bridge between a SQL Table and a client side DataTable object. It performs the following tasks when data is retrieved from the Advanced SQL Engine to populate a DataTable:

The TdDataAdapter can be used with the TdCommandBuilder to automatically construct the SQL statements needed to push the updates back to the SQL Engine. The TdCommandBuilder will construct INSERT, UPDATE, and/or DELETE statements depending upon the action that was performed on each of the rows of the data tables. The TdDataAdapther will automatically set up TdCommands that will be used to execute the INSERT, UPDATE, and/or DELETE commands.

When an application uses the TdDataAdapter and TdCommandBuilder to update a SQL table the following tasks are performed:

  1. An application sets the TdDataAdapter.SelectCommand property to the desired SELECT statement and then call DataAdapter.Fill and pass in the DataTable as a parameter.
  2. The TdDataAdapter executes the TdCommand contained in the SelectCommand property and fills the DataTable with the data returned from the execution of the SELECT statement.
  3. The application then makes changes to the DataTable. After all the changes have been made DbDataAdapter.Update is called by the application to push the changes to Teradata.
  4. Based on the changes made to the DataTable, the TdCommandBuilder uses the table and column names specified in the SELECT statement to generate the SQL statements that are used to update the corresponding SQL table. TdCommand objects are setup and the TdDataAdapter executes the TdCommand objects.
    1. The TdDataAdapter invokes the delegates that have been assigned, by the application, to the TdDataAdapter.RowUpdated and TdDataAdapter.RowUpdating event objects as the events occur while updating the SQL table.
    2. The behavior of TdDataAdapter when an error occurs during the update of a row is determined by the DataAdapter.ContinueUpdateOnError property.

TdCommandBuilder is only capable of associating the data from a DataTable to one SQL table. Therefore, the SELECT statement must reference only a single table, and not contain any calculated columns.

In This Section

Restrictions

Batch Update

UseEnhancedSchemaTable Attribute

Specifying INSERT, UPDATE, DELETE Commands

Returning Provider Specific Types

Performance Considerations

Guidelines

See Also

For details regarding the ADO.NET DataAdapter and CommandBuilder, please refer to MSDN.

Updating Data Sources with DataAdapters