dotConnect for BigCommerce Documentation
Devart.Data.Bigcommerce Namespace / BigcommerceCommand Class / Connection Property
Example

In This Topic
    Connection Property (BigcommerceCommand)
    In This Topic
    Gets or sets the BigcommerceConnection used by this instance of the BigcommerceCommand.
    Syntax
    'Declaration
     
    Public Shadows Property Connection As BigcommerceConnection
    public new BigcommerceConnection Connection {get; set;}

    Property Value

    The connection to a data source. The default value is a null reference.
    Remarks

    BigcommerceConnection specified in this property will carry out all operations executed with this BigcommerceCommand.

    Example
    The following example creates a BigcommerceCommand and sets some of its properties.
    public void CreateCommand()
    {
      string mySelectQuery = "SELECT * FROM customers ORDER BY id";
      BigcommerceCommand bigcommerceCommand = new BigcommerceCommand(mySelectQuery);
      bigcommerceCommand.Connection = new BigcommerceConnection(
        "Server=https://bigcommerce-store.mybigcommerce.com/api/v2/;User Id=User;Authentication Token=qweASDzcx1234567890rtyuiqweASDzcx1234567;");
      bigcommerceCommand.CommandType = System.Data.CommandType.Text;
    }
    Public Sub CreateCommand()
      Dim mySelectQuery As String = _
        "SELECT * FROM customers ORDER BY id"
      Dim bigcommerceCommand As New BigcommerceCommand(mySelectQuery)
      bigcommerceCommand.Connection = New BigcommerceConnection( _
        "Server=https://bigcommerce-store.mybigcommerce.com/api/v2/;User Id=User;Authentication Token=qweASDzcx1234567890rtyuiqweASDzcx1234567;")
      bigcommerceCommand.CommandType = System.Data.CommandType.Text
    End Sub
    See Also