Send feedback on this topic.
TdDataAdapter Class
Members  Example 

Teradata.Client.Provider Namespace : TdDataAdapter Class
TdDataAdpater fills a DataSet with the data from the Teradata Database and conversely updates the Teradata Database with the data in a DataSet.
Object Model
TdDataAdapter ClassTdCommand ClassTdCommand ClassTdCommand ClassTdCommand Class

The TdDataAdapter retrieves data from Teradata Database and fills a single DataTable within a DataSet. It is also capable of reconciling changes (UPDATE, INSERT, DELETE) to the DataTable to the Teradata Database.

TdDataAdapter can create the DataTable(s) from SELECT statement’s metadata, or it can map the result set(s) to an existing DataTable(s). In either case, data is retrieved from the Teradata Database and inserted / merged into the DataTable. For additional information on naming conventions see DbDataAdapter.Fill method.

TdDataAdapter, working in conjunction with TdCommandBuilder, is capable of automatically generating DML (UPDATE, INSERT and DELETE) statements for reconciling updates to a DataSet. However, UpdateCommand, InsertCommand and DeleteCommand properties can be manually setup as needed or alternatively registered to listen for RowUpdating events and to modify the DML generated by the TdCommandBuilder.

The Data Provider will detect a Parameter declaration discrepancy when Batch Update (TdDataAdapter.UpdateBatchSize > 1) is enabled and Data.Common.DataAdapter.ContinueUpdateOnError is set to true. The Data Provider detects that the TdParameter.IsNullable property is set to false but the TdParameter.Value is set to DBNull.Value. The Data Provider sets the Data.DataRow.HasErrors property to true and Data.DataRow.RowError property to Error # 121007 when it detects this issue. The Teradata Database will detect this discrepancy when Batch Update (UpdateBatchSize == 1) is turned off or ContinueUpdateOnError is set to false. The Teradata Database will return error # 2869.

The following example fills a DataSet with result set(s) returned from Teradata Database.
public DataSet CreateDataSet(String connectionString, String commandText)
   TdDataAdapter adapter = new TdDataAdapter(connectionString, commandText);
   DataSet ds = new DataSet();
   return ds;
Inheritance Hierarchy



Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2

See Also


TdDataAdapter Members
Teradata.Client.Provider Namespace