コード例 #1
0
        public static bool UpgradeUserDB(SQLiteConnectionUser conn)
        {
            int dbver;
            try
            {
                SQLiteDBClass.ExecuteQuery(conn, "CREATE TABLE IF NOT EXISTS Register (ID TEXT PRIMARY KEY NOT NULL, ValueInt INTEGER, ValueDouble DOUBLE, ValueString TEXT, ValueBlob BLOB)");
                dbver = conn.GetSettingIntCN("DBVer", 1);        // use the constring one, as don't want to go back into ConnectionString code

                DropOldUserTables(conn);

                if (dbver < 2)
                    UpgradeUserDB2(conn);

                if (dbver < 4)
                    UpgradeUserDB4(conn);

                if (dbver < 7)
                    UpgradeUserDB7(conn);

                if (dbver < 9)
                    UpgradeUserDB9(conn);

                if (dbver < 10)
                    UpgradeUserDB10(conn);

                if (dbver < 11)
                    UpgradeUserDB11(conn);

                if (dbver < 12)
                    UpgradeUserDB12(conn);

                if (dbver < 16)
                    UpgradeUserDB16(conn);

                if (dbver < 101)
                    UpgradeUserDB101(conn);

                if (dbver < 102)
                    UpgradeUserDB102(conn);

                if (dbver < 103)
                    UpgradeUserDB103(conn);

                if (dbver < 104)
                    UpgradeUserDB104(conn);

                if (dbver < 105)
                    UpgradeUserDB105(conn);

                CreateUserDBTableIndexes();

                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("UpgradeUserDB error: " + ex.Message);
                MessageBox.Show(ex.StackTrace);
                return false;
            }
        }
コード例 #2
0
        public static bool UpgradeUserDB(SQLiteConnectionUser conn)
        {
            int dbver;

            try
            {
                SQLiteDBClass.ExecuteQuery(conn, "CREATE TABLE IF NOT EXISTS Register (ID TEXT PRIMARY KEY NOT NULL, ValueInt INTEGER, ValueDouble DOUBLE, ValueString TEXT, ValueBlob BLOB)");
                dbver = conn.GetSettingIntCN("DBVer", 1);        // use the constring one, as don't want to go back into ConnectionString code

                DropOldUserTables(conn);

                if (dbver < 2)
                {
                    UpgradeUserDB2(conn);
                }

                if (dbver < 4)
                {
                    UpgradeUserDB4(conn);
                }

                if (dbver < 7)
                {
                    UpgradeUserDB7(conn);
                }

                if (dbver < 9)
                {
                    UpgradeUserDB9(conn);
                }

                if (dbver < 10)
                {
                    UpgradeUserDB10(conn);
                }

                if (dbver < 11)
                {
                    UpgradeUserDB11(conn);
                }

                if (dbver < 12)
                {
                    UpgradeUserDB12(conn);
                }

                if (dbver < 16)
                {
                    UpgradeUserDB16(conn);
                }

                if (dbver < 101)
                {
                    UpgradeUserDB101(conn);
                }

                if (dbver < 102)
                {
                    UpgradeUserDB102(conn);
                }

                if (dbver < 103)
                {
                    UpgradeUserDB103(conn);
                }

                if (dbver < 104)
                {
                    UpgradeUserDB104(conn);
                }

                if (dbver < 105)
                {
                    UpgradeUserDB105(conn);
                }

                if (dbver < 106)
                {
                    UpgradeUserDB106(conn);
                }

                if (dbver < 107)
                {
                    UpgradeUserDB107(conn);
                }

                if (dbver < 108)
                {
                    UpgradeUserDB108(conn);
                }

                if (dbver < 109)
                {
                    UpgradeUserDB109(conn);
                }

                if (dbver < 110)
                {
                    UpgradeUserDB110(conn);
                }

                if (dbver < 111)
                {
                    UpgradeUserDB111(conn);
                }

                if (dbver < 112)
                {
                    UpgradeUserDB112(conn);
                }

                CreateUserDBTableIndexes(conn);

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show("UpgradeUserDB error: " + ex.Message);
                MessageBox.Show(ex.StackTrace);
                return(false);
            }
        }