dotConnect for Salesforce Marketing Cloud Documentation
Devart.Data.ExactTarget Namespace / ExactTargetCommand Class / ExactTargetCommand Constructor / ExactTargetCommand Constructor(String,ExactTargetConnection)
The text of the query.
A ExactTargetConnection object that represents the connection to ExactTarget.
Example

In This Topic
    ExactTargetCommand Constructor(String,ExactTargetConnection)
    In This Topic
    Initializes a new instance of the ExactTargetCommand class with the text of the query and a %% object.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal commandText As String, _
       ByVal connection As ExactTargetConnection _
    )
    public ExactTargetCommand( 
       string commandText,
       ExactTargetConnection connection
    )

    Parameters

    commandText
    The text of the query.
    connection
    A ExactTargetConnection object that represents the connection to ExactTarget.
    Remarks
    The following table shows initial property values for an instance of ExactTargetCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 30
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a ExactTargetCommand and sets some of its properties.
    public void CreateCommand()
    {
      ExactTargetConnection exactTargetConnection = new ExactTargetConnection(
          "user=MyCompanyAdmin;password=mypassword;url=https://webservice.s7.exacttarget.com/Service.asmx;");
      string mySelectQuery = "SELECT * FROM Email";
      ExactTargetCommand exactTargetCommand = new ExactTargetCommand(mySelectQuery, exactTargetConnection);
      exactTargetCommand.FetchSize = 100;
    }
    Public Sub CreateCommand()
      Dim exactTargetConnection As New ExactTargetConnection( _
        "user=MyCompanyAdmin;password=mypassword;url=https://webservice.s7.exacttarget.com/Service.asmx;")
      Dim mySelectQuery As String = _
        "SELECT * FROM Email"
      Dim exactTargetCommand As New ExactTargetCommand(mySelectQuery, exactTargetConnection)
      exactTargetCommand.FetchSize = 100
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also