当前位置: 首页>>代码示例>>C#>>正文


C# SQLite.SQLiteTransaction类代码示例

本文整理汇总了C#中System.Data.SQLite.SQLiteTransaction的典型用法代码示例。如果您正苦于以下问题:C# SQLiteTransaction类的具体用法?C# SQLiteTransaction怎么用?C# SQLiteTransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SQLiteTransaction类属于System.Data.SQLite命名空间,在下文中一共展示了SQLiteTransaction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Transaction

        public Transaction(SQLiteTransaction transaction)
        {
            if (_base == null)
                throw new ArgumentNullException("transaction");

            _base = transaction;
        }
开发者ID:erikvdv1,项目名称:iphone-message-import,代码行数:7,代码来源:Transaction.cs

示例2: CreateAddProductCommand

        public SQLiteCommand CreateAddProductCommand(SQLiteConnection conn, SQLiteTransaction transaction)
        {
            var cmd = new SQLiteCommand(_sql, conn, transaction);
            CreateParameters(cmd);

            return cmd;
        }
开发者ID:cwbrandsma,项目名称:FluentAdo,代码行数:7,代码来源:InsertPerformanceTests.cs

示例3: PrepareCommand

        internal static void PrepareCommand(SQLiteCommand command, SQLiteConnection connection, SQLiteTransaction transaction,
                                           CommandType commandType, string commandText, SQLiteParameter[] commandParameters,
                                           out bool mustCloseConnection)
        {
            if (command == null) throw new ArgumentNullException("command");
            if (string.IsNullOrEmpty(commandText)) throw new ArgumentNullException("commandText");

            if (connection.State == ConnectionState.Open)
                mustCloseConnection = false;
            else
            {
                mustCloseConnection = true;
                connection.Open();
            }

            command.Connection = connection;
            command.CommandText = commandText;

            if (transaction != null)
            {
                if (transaction.Connection == null)
                    throw new ArgumentException(
                        "The transaction was rollbacked or commited, please provide an open transaction.", "transaction");
                command.Transaction = transaction;
            }

            command.CommandType = commandType;

            if (commandParameters != null)
                AttachParameters(command, commandParameters);
            return;
        }
开发者ID:sreenandini,项目名称:test_buildscripts,代码行数:32,代码来源:SQLiteHelper.cs

示例4: SQLiteTransaction

 public SQLiteTransaction(SQLiteDatabase database, IsolationLevel level, SQLiteSettings settings)
 {
   _database = database;
   _settings = settings;
   _connection = _database.ConnectionPool.GetConnection();
   _transaction = _connection.BeginTransaction(level);
 }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:7,代码来源:SQLiteTransaction.cs

示例5: GetCommandOnCurrentConnect

        public SQLiteCommand GetCommandOnCurrentConnect(String commandText, out SQLiteTransaction sqLiteTransaction){
            var connection = GetCurrentConnection();

            sqLiteTransaction = connection.BeginTransaction();

            return new SQLiteCommand(commandText, connection, sqLiteTransaction);
        }
开发者ID:kisflying,项目名称:kion,代码行数:7,代码来源:SqliteHelper.cs

示例6: ExecuteNonQuery

		protected long ExecuteNonQuery(
			string                       sql,
			IEnumerable<SQLiteParameter> parameters,
			SQLiteTransaction            transaction = null
		)
		{
			long iRows = 0L;

			this.Logger.DebugFormat("Datasource:'{0}';sql:'{1}'",
				this.Connection.DataSource,
				sql
			);

			using (SQLiteCommand command = this.GetCommand(sql, transaction))
			{
				if (parameters != null)
				{
					foreach (SQLiteParameter parameter in parameters)
					{
						command.Parameters.Add(parameter);
					}
				}

				iRows = command.ExecuteNonQuery();
			}

			// this.Logger.DebugFormat("ExecuteNonQuery:ExecuteNonQuery:sql:'{0}';rows:'{1}'",
			//    sql,
			//    iRows
			// );

			return iRows;
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:33,代码来源:CommandBase.cs

示例7: SQLiteCommand

		public SQLiteCommand(string commandText, SQLiteConnection connection, SQLiteTransaction transaction)
		{
			CommandText = commandText;
			DbConnection = connection;
			DbTransaction = transaction;
			m_parameterCollection = new SQLiteParameterCollection();
		}
开发者ID:sakurahoshi,项目名称:System.Data.SQLite,代码行数:7,代码来源:SQLiteCommand.cs

示例8: GetCommand

		private SQLiteCommand GetCommand(string sql, SQLiteTransaction transaction)
		{
			return new SQLiteCommand(
				sql,
				this.Connection,
				transaction
			);
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:8,代码来源:CommandBase.cs

示例9: SetCommandConstraints

		public void SetCommandConstraints(
			string                       clause,
			IEnumerable<SQLiteParameter> parameters,
			SQLiteTransaction            transaction = null
		)
		{
			this._clause      = clause;
			this._parameters  = parameters;
			this._transaction = transaction;
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:10,代码来源:RowDeleteCommand.cs

示例10: SQLiteMonTransaction

        public SQLiteMonTransaction(SQLiteTransaction transaction)
        {
            this.wrappedTrans = transaction;

            StackTrace trace = new StackTrace(true);

            lock (readerInfoLock)
            {
                readerInfo.Add(this.wrappedTrans, trace.ToString());
            }
        }
开发者ID:ribbons,项目名称:RadioDownloader,代码行数:11,代码来源:SQLiteMonTransaction.cs

示例11: Persist

        /// <summary>
        /// Takes a GIS model and a file and writes the model to that file.
        /// </summary>
        /// <param name="model">
        /// The GisModel which is to be persisted.
        /// </param>
        /// <param name="fileName">
        /// The name of the file in which the model is to be persisted.
        /// </param>
        public void Persist(GisModel model, string fileName)
        {
            Initialize(model);
            PatternedPredicate[] predicates = GetPredicates();

            if (	File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            using (mDataConnection = new SQLiteConnection("Data Source=" + fileName + ";New=True;Compress=False;Synchronous=Off;UTF8Encoding=True;Version=3"))
            {
                mDataConnection.Open();
                mDataCommand = mDataConnection.CreateCommand();
                CreateDataStructures();

                using (mDataTransaction = mDataConnection.BeginTransaction())
                {
                    mDataCommand.Transaction = mDataTransaction;

                    CreateModel(model.CorrectionConstant, model.CorrectionParameter);
                    InsertOutcomes(model.GetOutcomeNames());
                    InsertPredicates(predicates);
                    InsertPredicateParameters(model.GetOutcomePatterns(), predicates);

                    mDataTransaction.Commit();
                }
                mDataConnection.Close();
            }
        }
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:39,代码来源:SqliteGisModelWriter.cs

示例12: open

 public void open()
 {
     SetConnection();
     sql_con.Open();
     _sqLiteTransaction = sql_con.BeginTransaction();
     sql_cmd = sql_con.CreateCommand();
 }
开发者ID:latys,项目名称:zhuotie,代码行数:7,代码来源:dbHepler.cs

示例13: CommitTransaction

 public void CommitTransaction()
 {
     globalTransaction.Commit();
     globalTransaction.Dispose();
     globalTransaction = null;
     Close();
 }
开发者ID:NoxHarmonium,项目名称:enform,代码行数:7,代码来源:SQLiteDatabase.cs

示例14: SQLiteEnlistment

    internal SQLiteEnlistment(SQLiteConnection cnn, Transaction scope)
    {
      _transaction = cnn.BeginTransaction();
      _scope = scope;

      _scope.EnlistVolatile(this, System.Transactions.EnlistmentOptions.None);
    }
开发者ID:vertica-as,项目名称:sqlite-netFx-source-1.0.88.0,代码行数:7,代码来源:SQLiteEnlistment.cs

示例15: Dispose

    ///////////////////////////////////////////////////////////////////////////////////////////////

    private /* protected virtual */ void Dispose(bool disposing)
    {
        if (!disposed)
        {
            if (disposing)
            {
                ////////////////////////////////////
                // dispose managed resources here...
                ////////////////////////////////////

                if (_transaction != null)
                {
                    _transaction.Dispose();
                    _transaction = null;
                }

                if (_scope != null)
                {
                    // _scope.Dispose(); // NOTE: Not "owned" by us.
                    _scope = null;
                }
            }

            //////////////////////////////////////
            // release unmanaged resources here...
            //////////////////////////////////////

            disposed = true;
        }
    }
开发者ID:vertica-as,项目名称:sqlite-netFx-source-1.0.88.0,代码行数:32,代码来源:SQLiteEnlistment.cs


注:本文中的System.Data.SQLite.SQLiteTransaction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。