dotConnect for QuickBooks Online Documentation
Devart.Data.QuickBooks Namespace / QuickBooksConnection Class / Clone Method
Example

In This Topic
    Clone Method (QuickBooksConnection)
    In This Topic
    Creates a new object that is a copy of the current instance.
    Syntax
    'Declaration
     
    Public Function Clone() As QuickBooksConnection
    public QuickBooksConnection Clone()

    Return Value

    A new QuickBooksConnection object.
    Remarks

    Creates a new QuickBooksConnection object with the properties that have the same values as those of the original object. However, changing properties of the new object has no influence on the values of the same properties of the original object.

    Note that state of the new instance is always Closed, regardless of the state of original instance.

    Example
    This example shows how to clone a QuickBooksConnection. To make sure all the properties are inherited, one of them (UserId) is written to the console.
    public void CloneAConnection()
    {
      QuickBooksConnection quickBooksConnection = new QuickBooksConnection(
          "Company Id=1440905870;Refresh Token=AB11590759756UCO8O6CpRQcAMP00sIANafgS8Y4RN10rpLJNM;Token Server=file://D:\\temp\\QuickBooksToken.txt");
      QuickBooksConnection quickBooksConnection2 = (QuickBooksConnection)quickBooksConnection.Clone();
      Console.WriteLine(quickBooksConnection2.UserId);
    }
    Public Sub CloneAConnection()
      Dim quickBooksConnection As New QuickBooksConnection( _
          "Company Id=1440905870;Refresh Token=AB11590759756UCO8O6CpRQcAMP00sIANafgS8Y4RN10rpLJNM;Token Server=file://D:\\temp\\QuickBooksToken.txt")
      Dim quickBooksConnection2 As QuickBooksConnection = CType(quickBooksConnection.Clone(), QuickBooksConnection)
      Console.WriteLine(quickBooksConnection2.UserId)
    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