コード例 #1
0
ファイル: sqlite.cs プロジェクト: redrgb/localVersonControl
 /// <summary>
 /// executes command using Parameters
 /// </summary>
 /// <param name="command"></param>
 /// <param name="parms"></param>
 /// <returns>rows affected or -1 for error</returns>
 public override int execute(string command, Parameters parms)
 {
     if (this.connection.State != ConnectionState.Open)
     {
         this.connection.Open();
     }
     int status;
     SQLiteCommand sqliteCommand = new SQLiteCommand(command, this.connection);
     sqliteCommand.Parameters.AddRange(parms.getParameters());
     try
     {
         status = sqliteCommand.ExecuteNonQuery();
     }
     catch
     {
         return -1;
     }
     return status;
 }
コード例 #2
0
ファイル: sqlite.cs プロジェクト: redrgb/localVersonControl
        /// <summary>
        /// Runs query command given using parameters
        /// </summary>
        /// <param name="command"></param>
        /// <param name="parms"></param>
        /// <returns>results of query</returns>
        public override DbDataReader query(string command, Parameters parms)
        {
            if (this.connection.State == ConnectionState.Closed)
            {
                this.connection.Open();
            }
            SQLiteCommand sqliteCommand = new SQLiteCommand(command, this.connection);
            sqliteCommand.Parameters.AddRange(parms.getParameters());
            SQLiteDataReader results = sqliteCommand.ExecuteReader();

            this.lastQuery = results;

            return results;
        }
コード例 #3
0
ファイル: dbAccess.cs プロジェクト: redrgb/localVersonControl
 /// <summary>
 /// executes command using Parameters
 /// </summary>
 /// <param name="command"></param>
 /// <param name="parms"></param>
 /// <returns>rows affected or -1 for error</returns>
 public abstract int execute(string command, Parameters parms);
コード例 #4
0
ファイル: sqlite.cs プロジェクト: redrgb/localVersonControl
        /// <summary>
        /// fills a data table using query given
        /// </summary>
        /// <param name="command"></param>
        /// <param name="parms"></param>
        /// <returns>datatable</returns>
        public DataTable fill(string command, Parameters parms)
        {
            if (this.connection.State == ConnectionState.Closed)
            {
                this.connection.Open();
            }

            SQLiteCommand sqliteCommand = new SQLiteCommand(command, this.connection);
            sqliteCommand.Parameters.AddRange(parms.getParameters());
            SQLiteDataAdapter sqliteAd = new SQLiteDataAdapter(sqliteCommand);

            DataTable dt = new DataTable();
            sqliteAd.Fill(dt);

            this.lastQuery = sqliteCommand.ExecuteReader();

            return dt;
        }
コード例 #5
0
ファイル: dbAccess.cs プロジェクト: redrgb/localVersonControl
 /// <summary>
 /// Runs query command given using parameters
 /// </summary>
 /// <param name="command"></param>
 /// <param name="parms"></param>
 /// <returns>results of query</returns>
 public abstract DbDataReader query(string command, Parameters parms);