dotConnect for Adobe Commerce Documentation
Devart.Data.Magento Namespace / MagentoConnection Class / MagentoConnection Constructor / MagentoConnection Constructor(String)
The connection used to connect to Adobe Commerce.
Example

In This Topic
    MagentoConnection Constructor(String)
    In This Topic
    Initializes a new instance of the MagentoConnection class when given a string containing the connection string.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal connectionString As String _
    )
    public MagentoConnection( 
       string connectionString
    )

    Parameters

    connectionString
    The connection used to connect to Adobe Commerce.
    Remarks
    When a new instance of MagentoConnection is created, the read/write properties are set to the following initial values unless they are specifically set using their associated keywords in the ConnectionString property.
    Example
    The following example creates and opens a MagentoConnection.
    public void CreateMagentoConnection()
    {
      string myConnString = 
          "domain=192.168.10.68/magento;user=Test;apikey=testpassword;";
      MagentoConnection adobe commerceConnection = new MagentoConnection(myConnString);
      adobe commerceConnection.Open();
      //Do something
      adobe commerceConnection.Close();
    }
    Public Sub CreateMagentoConnection()
      Dim myConnString As String = _
          "domain=192.168.10.68/magento;user=Test;apikey=testpassword;"
      Dim adobe commerceConnection As New MagentoConnection(myConnString)
      adobe commerceConnection.Open()
      'Do something
      adobe commerceConnection.Close()
    End Sub
    See Also