Mono.Data.Sqlite.SqliteConnection.Clone C# (CSharp) Méthode

Clone() public méthode

Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection will also be opened.
public Clone ( ) : object
Résultat object
    public object Clone()
    {
      return new SqliteConnection(this);
    }

Usage Example

Exemple #1
0
        public void AddItem(string item, double cost)
        {
            string connectionstring = @"URI=file:Item.db";
            SqliteConnection sqcon = new SqliteConnection (connectionstring);
            sqcon.Open ();
            SqliteCommand sqcmd = sqcon.CreateCommand ();

            string sql = @"INSERT INTO items(item, cost) VALUES(@item, @cost);";
            sqcmd.CommandText = sql;
            sqcmd.Prepare ();

            sqcmd.Parameters.AddWithValue ("@item", item);
            sqcmd.Parameters.AddWithValue ("@cost", cost);
            sqcmd.ExecuteNonQuery ();

            sqcmd.Dispose ();
            sqcon.Clone ();

            Console.WriteLine ("item {0} successfully added!", item);
        }
All Usage Examples Of Mono.Data.Sqlite.SqliteConnection::Clone