Ejemplo n.º 1
0
        public bool CreateDB(string dbName)
        {
            string dbFile = MemData.MemDataSqlite + "/" + dbName + ".db";

            SQLiteConnection.CreateFile(dbFile);
            ConnectDB(dbName);
            OpenDB();

            //创建profile表
            cmd.CommandText = "create table tree_profile("
                              + "k varchar(16),"
                              + "v varchar(32))";
            cmd.ExecuteNonQuery();

            //创建calc表
            cmd.CommandText = "create table tree_calc"
                              + DBUtil.GetCreateTableSql();
            cmd.ExecuteNonQuery();

            CloseDB();

            return(true);
        }
Ejemplo n.º 2
0
        public bool CreateDB(string dbName)
        {
            dbNameProfile = dbName + "_profile";
            dbNameCalc    = dbName + "_calc";
            OpenDB();

            //创建profile表
            cmd.CommandText = "create table "
                              + dbNameProfile
                              + "(k varchar(16),"
                              + "v varchar(32))engine=MyISAM";
            cmd.ExecuteNonQuery();

            //创建calc表
            cmd.CommandText = "create table "
                              + dbNameCalc
                              + DBUtil.GetCreateTableSql()
                              + "engine=MyISAM";
            cmd.ExecuteNonQuery();

            CloseDB();

            return(true);
        }