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



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

Parameters

commandText
A string representing a query (TdCommand.CommandText) used to fill a DataSet.
connectionString
The Connection String used to create an instance of the 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 parameter initializes the SelectCommand property with a new instance of the TdCommand class. The active connection of the SelectCommand property is set to a new instance of the TdConnection class initialized with the selectConectionString parameter.

See the SelectCommand property as to how it is used to fill the DataSet. The 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(String selectCmdText, String connectionString)
{
    DataSet ds = new DataSet();
    TdDataAdapter adapter = new TdDataAdapter(selectCmdText, connectionString);
    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