Ejemplo n.º 1
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);
        }
		public IDbTransaction BeginTransaction ()
		{
			if (state != ConnectionState.Open)
				throw new InvalidOperationException("Invalid operation: The connection is close");
			
			SqliteTransaction t = new SqliteTransaction();
			t.Connection = this;
			SqliteCommand cmd = this.CreateCommand();
			cmd.CommandText = "BEGIN";
			cmd.ExecuteNonQuery();
			return t;
		}
Ejemplo n.º 3
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;
        }
 private void ExecuteNonQuery(string sql, SqliteConnection conn, SqliteTransaction tran)
 {
     string[] sqlArray = SplitSqlString(sql);
     foreach (string sqlString in sqlArray)
     {
         SqliteCommand cmd = new SqliteCommand(sqlString, conn, tran);
         cmd.CommandTimeout = 1200;
         cmd.ExecuteNonQuery();
     }
 }