Send feedback on this topic.
Teradata.Client.Provider
TdDataAdapter Constructor(String,TdConnection)
Example 



Teradata.Client.Provider Namespace > TdDataAdapter Class > TdDataAdapter Constructor : TdDataAdapter Constructor(String,TdConnection)
Specifies a string representing a query (TdCommand.CommandText) used to fill a DataSet.
Contains an instance of TdConnection class.
Initializes a new instance of the TdDataAdapter class and sets the SelectCommand property.
Syntax
'Declaration
 
Public Function New( _
   ByVal commandText As String, _
   ByVal connection As TdConnection _
)
'Usage
 
Dim commandText As String
Dim connection As TdConnection
 
Dim instance As New TdDataAdapter(commandText, connection)
public TdDataAdapter( 
   string commandText,
   TdConnection connection
)
public:
TdDataAdapter( 
   String^ commandText,
   TdConnection^ connection
)

Parameters

commandText
Specifies a string representing a query (TdCommand.CommandText) used to fill a DataSet.
connection
Contains an instance of TdConnection class.
Remarks
A new instance of TdDataAdapter class is initialized with the following default property values.
Property Initial Value
AcceptChangesDuringFill true
ContinueUpdateOnError false
DeleteCommand null
InsertCommand null
MissingMappingAction MissingMappingAction.Passthrough
MissingSchemaAction MissingSchemaAction.Add
SelectCommand New instance of TdCommand(selectCommandText, selectConnection) class
UpdateCommand null

The selectCommandText and selectConnection parameters initialize the SelectCommand property with a new instance of the TdCommand class. See the SelectCommand property to determine how it is used to fill the DataSet. SelectCommand is also used by the TdCommandBuilder to generate DML statements.

Example
The following example creates an instance of TdDataAdapter class, sets some of the properties and fills a DataSet.
public DataSet ExecuteQuery(TdCommand selectCmd)
{
    DataSet ds = new DataSet();
    TdDataAdapter adapter = new TdDataAdapter(selectCmdText, connection);
                                                             
    adapter.Fill(ds);
             
    return ds;
}
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdDataAdapter Class
TdDataAdapter Members
Overload List