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