dotConnect for Adobe Commerce 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 Adobe Commerce.
Example

MagentoCommand Constructor(String,MagentoConnection)
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 _
)
 

Parameters

commandText
The text of the query.
connection
A MagentoConnection object that represents the connection to Adobe Commerce.
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 adobe commerceConnection = new MagentoConnection(
      "domain=192.168.10.68/magento;user=Test;apikey=testpassword;");
  string mySelectQuery = "SELECT * FROM Customers";
  MagentoCommand adobe commerceCommand = new MagentoCommand(mySelectQuery, adobe commerceConnection);
  adobe commerceCommand.FetchSize = 100;
}
Public Sub CreateCommand()
  Dim adobe commerceConnection As New MagentoConnection( _
    "domain=192.168.10.68/magento;user=Test;apikey=testpassword;")
  Dim mySelectQuery As String = _
    "SELECT * FROM Customers"
  Dim adobe commerceCommand As New MagentoCommand(mySelectQuery, adobe commerceConnection)
  adobe commerceCommand.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