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

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

    Return Value

    A new SnowflakeCommand object in which all property values are the same as the original.
    Remarks
    Use this method when you need to create a new SnowflakeCommand object that is absolutely like existing one.
    Example
    This example shows how to clone a SnowflakeCommand . To make sure all the properties are inherited, one of them (CommandText) is written to the console.
    public void CloneACommand()
    {
      SnowflakeCommand snowflakeCommand = new SnowflakeCommand("SELECT * FROM your_database.your_schema.employees");
            SnowflakeCommand snowflakeCommand2 = (SnowflakeCommand)snowflakeCommand.Clone();
      Console.WriteLine(snowflakeCommand2.CommandText);
    }
    Public Sub CloneACommand()
      Dim snowflakeCommand As New SnowflakeCommand("SELECT * FROM your_database.your_schema.employees")
      Dim snowflakeCommand2 As SnowflakeCommand = CType(snowflakeCommand.Clone(), SnowflakeCommand)
      Console.WriteLine(snowflakeCommand2.CommandText)
    End Sub
    See Also