dotConnect for Google BigQuery Documentation
Devart.Data.BigQuery Namespace / BigQueryConnection Class / Clone Method
Example

On this page
    Clone Method (BigQueryConnection)
    On this page
    Creates a new object that is a copy of the current instance.
    Syntax
    'Declaration
     
    Public Function Clone() As BigQueryConnection
    public BigQueryConnection Clone()

    Return Value

    A new BigQueryConnection object.
    Remarks

    Creates a new BigQueryConnection 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 BigQueryConnection. To make sure all the properties are inherited, one of them (UserId) is written to the console.
    public void CloneAConnection()
    {
      BigQueryConnection bigQueryConnection = new BigQueryConnection(
          @"Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********");
      BigQueryConnection bigQueryConnection2 = (BigQueryConnection)bigQueryConnection.Clone();
      Console.WriteLine(bigQueryConnection2.UserId);
    }
    Public Sub CloneAConnection()
      Dim bigQueryConnection As New BigQueryConnection( _
          "Authentication Type=ServiceAccount;ServiceAccount Json=C:\keys\service-account.json;Project Id=your_project;DataSet Id=your_dataset;License Key=**********")
      Dim bigQueryConnection2 As BigQueryConnection = CType(bigQueryConnection.Clone(), BigQueryConnection)
      Console.WriteLine(bigQueryConnection2.UserId)
    End Sub
    See Also