Пример #1
0
        public void CreateElementTable <T>(string tableName) where T : DatabaseItem, new()
        {
            T dt = new T();

            StringBuilder sbElements = new StringBuilder();
            {
                bool justCreated = true;

                foreach (sqliteBase sElement in dt.values)
                {
                    if (justCreated)
                    {
                        justCreated = false;
                    }
                    else
                    {
                        sbElements.Append(", ");
                    }
                    sbElements.Append(sElement.valueName + " " + sElement.dataType);
                }
            }

            string sql_command = "CREATE TABLE " + tableName + " ( " + sbElements.ToString() + ")";

            SQLiteCommandsExecuter.executeNonQuery(sql_command, DCore.M_dbConnection);
        }
Пример #2
0
        public void DelTable(string tableName)
        {
            string sql = "DROP TABLE " + tableName;;

            SQLiteCommandsExecuter.executeNonQuery(sql, M_dbConnection);
        }
Пример #3
0
        public void DelElement(string tableName, sqliteInt rowID)
        {
            string sql = "DELETE FROM " + tableName + " WHERE " + rowID.valueName + " = " + rowID.value;

            SQLiteCommandsExecuter.executeNonQuery(sql, M_dbConnection);
        }