dotConnect for Magento Documentation
Devart.Data.Magento Namespace / MagentoCommand Class / MagentoCommand Constructor / MagentoCommand Constructor(String,MagentoConnection)
The text of the query.
A MagentoConnection object that represents the connection to Magento.
Example

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

    Parameters

    commandText
    The text of the query.
    connection
    A MagentoConnection object that represents the connection to Magento.
    Remarks
    The following table shows initial property values for an instance of MagentoCommand.
    Properties Initial value
    CommandText commandText
    CommandTimeout 30
    CommandType System.Data.CommandType.Text
    Connection connection
    Example
    The following example creates a MagentoCommand and sets some of its properties.
    public void CreateCommand()
    {
      MagentoConnection magentoConnection = new MagentoConnection(
          "domain=192.168.10.68/magento;user=Test;apikey=testpassword;");
      string mySelectQuery = "SELECT * FROM Customers";
      MagentoCommand magentoCommand = new MagentoCommand(mySelectQuery, magentoConnection);
      magentoCommand.FetchSize = 100;
    }
    Public Sub CreateCommand()
      Dim magentoConnection As New MagentoConnection( _
        "domain=192.168.10.68/magento;user=Test;apikey=testpassword;")
      Dim mySelectQuery As String = _
        "SELECT * FROM Customers"
      Dim magentoCommand As New MagentoCommand(mySelectQuery, magentoConnection)
      magentoCommand.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