Exemplo n.º 1
0
        /// <summary>
        /// Create a SQL request for updates the table entries corresponding to the <see cref="SQLiteCaseValue"/>
        /// </summary>
        /// <param name="tableName">Name of the table to updates; Cannot be null or empty</param>
        /// <param name="multiUpdate"><see cref="SQLiteCaseValue"/> to write in the table; Cannot be null or empty</param>
        /// <returns></returns>
        static public string SQL_Update(string tableName, SQLiteCaseValue multiUpdate)
        {
            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new ArgumentNullException(nameof(tableName));
            }
            if (multiUpdate == null)
            {
                throw new ArgumentNullException(nameof(multiUpdate));
            }
            if (multiUpdate.Count == 0)
            {
                throw new ArgumentException("The " + nameof(multiUpdate) + " {" + nameof(SQLiteCaseValue) + "} cannot be empty.", nameof(multiUpdate));
            }

            string rslt = "UPDATE " + tableName.ToSQLiteFormat() + " SET " + multiUpdate.GetCASE() +
                          "\nWHERE " + multiUpdate.GetOR();

            return(rslt.Trim() + ";");
        }
Exemplo n.º 2
0
 /// <summary>
 /// Updates the table entries corresponding to the <see cref="SQLiteCaseValue"/>
 /// </summary>
 /// <param name="tableName">Name of the table to updates; Cannot be null or empty</param>
 /// <param name="multiUpdate"><see cref="SQLiteCaseValue"/> to write in the table; Cannot be null or empty</param>
 /// <param name="msgErr"></param>
 /// <returns></returns>
 public int Update(string tableName, SQLiteCaseValue multiUpdate, out SQLlog msgErr)
 {
     return(ExecuteSQLcommand(SQL_Update(tableName, multiUpdate), out msgErr));
 }