Пример #1
0
        /// <summary>
        /// Create a SQL request for add column in a table
        /// </summary>
        /// <param name="tableName">Table to edit; Cannot be null or empty</param>
        /// <param name="column">Column to add to the table; Cannot be null or empty</param>
        /// <returns></returns>
        static public string SQL_EditTable_AddColumn(string tableName, SQLiteColumn column)
        {
            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new ArgumentNullException(nameof(tableName));
            }
            if (column == null)
            {
                throw new ArgumentNullException(nameof(column));
            }

            return(SQL_EditTable(tableName, " ADD " + column.Name.ToSQLiteFormat() + " " + SQLiteColumn.GetTypeString(column.Type)));
        }
Пример #2
0
 /// <summary>
 /// Add column to the table
 /// </summary>
 /// <param name="tableName">Table to edit; Cannot be null or empty</param>
 /// <param name="column">Columns to add to the table; Cannot be null or empty</param>
 /// <param name="msgErr"></param>
 /// <returns></returns>
 public int AddColumn(string tableName, SQLiteColumn column, out SQLlog msgErr)
 {
     return(ExecuteSQLcommand(SQL_EditTable_AddColumn(tableName, column), out msgErr));;
 }