dotConnect for SugarCRM Documentation
Devart.Data.Sugar Namespace / SugarCommand Class / Clone Method
Example

Clone Method (SugarCommand)
Creates a new object that is a copy of the current SugarCommand instance.
Creates a new object that is a copy of the current SugarCommand instance.
Syntax
'Declaration
 
Public Shadows Function Clone() As SugarCommand
 

Return Value

A new SugarCommand object in which all property values are the same as the original.
Remarks
Use this method when you need to create a new SugarCommand object that is absolutely like existing one.
Example
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
See Also