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