dotConnect for FreshBooks Documentation
Devart.Data.FreshBooks Namespace / FreshBooksCommand Class / Connection Property
Example

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

    Property Value

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

    FreshBooksConnection specified in this property will carry out all operations executed with this FreshBooksCommand.

    This property supports the InterForm technology.

    Example
    The following example creates a FreshBooksCommand and sets some of its properties.
    public void CreateCommand()
    {
      string mySelectQuery = "SELECT * FROM Client ORDER BY Id";
      FreshBooksCommand freshbooksCommand = new FreshBooksCommand(mySelectQuery);
      freshbooksCommand.Connection = new FreshBooksConnection(
        "API Version=Alpha;Access Token=3d3355b2beea67f9241400fbe28f0b116e3efd2f8a85dda3c35620acdc95cd60;Refresh Token=75836f50da63fc5bf81bb24598511ae131ea422e73d9f321b4c4a44e2dd1c67f;Company Name=Devart");
      freshbooksCommand.CommandType = System.Data.CommandType.Text;
    }
    Public Sub CreateCommand()
      Dim mySelectQuery As String = _
        "SELECT * FROM Client ORDER BY Id"
      Dim freshbooksCommand As New FreshBooksCommand(mySelectQuery)
      freshbooksCommand.Connection = New FreshBooksConnection( _
        "API Version=Alpha;Access Token=3d3355b2beea67f9241400fbe28f0b116e3efd2f8a85dda3c35620acdc95cd60;Refresh Token=75836f50da63fc5bf81bb24598511ae131ea422e73d9f321b4c4a44e2dd1c67f;Company Name=Devart")
      freshbooksCommand.CommandType = System.Data.CommandType.Text
    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