dotConnect for Snowflake Documentation
Devart.Data.Snowflake Namespace / SnowflakeConnection Class / Clone Method
Example

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

    Return Value

    A new SnowflakeConnection object.
    Remarks

    Creates a new SnowflakeConnection 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 SnowflakeConnection. To make sure all the properties are inherited, one of them (Database) is written to the console.
    public void CloneAConnection()
    {
      SnowflakeConnection snowflakeConnection = new SnowflakeConnection(
          "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********");
      SnowflakeConnection snowflakeConnection2 = (SnowflakeConnection)snowflakeConnection.Clone();
      Console.WriteLine(snowflakeConnection2.Database);
    }
    Public Sub CloneAConnection()
      Dim snowflakeConnection As New SnowflakeConnection( _
          "Domain=myorg-myaccount.snowflakecomputing.com;User=your_user;Password=********;Database=your_database;Schema=your_schema;Warehouse=your_warehouse;License Key=**********")
      Dim snowflakeConnection2 As SnowflakeConnection = CType(snowflakeConnection.Clone(), SnowflakeConnection)
      Console.WriteLine(snowflakeConnection2.Database)
    End Sub
    See Also