dotConnect for Salesforce Documentation
Devart.Data.Salesforce Namespace / SalesforceCommand Class / SalesforceCommand Constructor / SalesforceCommand Constructor(String,SalesforceConnection)
The text of the query.
A SalesforceConnection object that represents the connection to Salesforce.com or Database.com.
Example

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

    Parameters

    commandText
    The text of the query.
    connection
    A SalesforceConnection object that represents the connection to Salesforce.com or Database.com.
    Remarks
    The following table shows initial property values for an instance of SalesforceCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 30
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a SalesforceCommand and sets some of its properties.
    public void CreateCommand()
    {
      SalesforceConnection salesforceConnection = new SalesforceConnection(
          "Server=login.salesforce.com;User Id= [email protected];Password=mypassword;Security Token=qweASDzcx1234567890rtyui;");
      string mySelectQuery = "SELECT * FROM Account";
      SalesforceCommand salesforceCommand = new SalesforceCommand(mySelectQuery, salesforceConnection);
      salesforceCommand.FetchSize = 100;
    }
    Public Sub CreateCommand()
      Dim salesforceConnection As New SalesforceConnection( _
        "Server=login.salesforce.com;User Id= [email protected];Password=mypassword;Security Token=qweASDzcx1234567890rtyui;")
      Dim mySelectQuery As String = _
        "SELECT * FROM Account"
      Dim salesforceCommand As New SalesforceCommand(mySelectQuery, salesforceConnection)
      salesforceCommand.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