Clone Method (SugarCommand)
Creates a new object that is a copy of the current
SugarCommand instance.
'Declaration
Public Shadows Function Clone() As SugarCommand
Return Value
A new
SugarCommand object in which all property values are the same as the original.
This example shows how to clone a
SugarCommand . To make sure all the properties are inherited, one of them (CommandText) is written to the console.
public void CloneACommand()
{
SugarCommand sugarCommand = new SugarCommand("SELECT * FROM Campaigns");
SugarCommand sugarCommand2 = (SugarCommand)sugarCommand.Clone();
Console.WriteLine(sugarCommand2.CommandText);
}
Public Sub CloneACommand()
Dim sugarCommand As New SugarCommand("SELECT * FROM Campaigns")
Dim sugarCommand2 As SugarCommand = CType(sugarCommand.Clone(), SugarCommand)
Console.WriteLine(sugarCommand2.CommandText)
End Sub