public IDbTransaction BeginTransaction()
#endif
        {
            if (state != ConnectionState.Open)
            {
                throw new InvalidOperationException("Invalid operation: The connection is closed");
            }

            SqliteTransaction t = new SqliteTransaction();

#if NET_2_0
            t.SetConnection(this);
#else
            t.Connection = this;
#endif
            SqliteCommand cmd = (SqliteCommand)this.CreateCommand();
            cmd.CommandText = "BEGIN";
            cmd.ExecuteNonQuery();
            return(t);
        }
Exemple #2
0
			public IDbTransaction BeginTransaction ()
#endif
		{
			if (state != ConnectionState.Open)
				throw new InvalidOperationException("Invalid operation: The connection is closed");
			
			SqliteTransaction t = new SqliteTransaction();
#if NET_2_0
			t.SetConnection (this);
#else
			t.Connection = this;
#endif
			SqliteCommand cmd = (SqliteCommand)this.CreateCommand();
			cmd.CommandText = "BEGIN";
			cmd.ExecuteNonQuery();
			return t;
		}