[emu]how to sync data in sql with the server?

04/30/2014 16:29 cloudslsw#1
Code:
public void CreateCharacter(ulong accID, uint slot, uint avatar)
        {
            using (var con = GetConnection())
            {
                using (var cmd = BuildQuery(con, "INSERT INTO account_characters(AccountID, Slot, Avatar) VALUES(@AccountID, @Slot, @Avatar)", "@AccountID", accID, "@Slot", slot, "@Avatar", avatar))
                {
                    cmd.ExecuteNonQuery();
                }
                using (var cmd = BuildQuery(con,
                    "INSERT INTO account_inventory(AccountID, Category, SubCategory, ItemID, ProductID, EffectID, PurchaseTime, ExpireTime, Energy) VALUES(@AccountID, @Category, @SubCategory, @ItemID, @ProductID, @EffectID, @PurchaseTime, @ExpireTime, @Energy); SHOW TABLE STATUS LIKE 'account_inventory';",
                    "@AccountID", accID, "@Category", 3, "@SubCategory", 10, "@ItemID", 1, "@ProductID", 3, "@EffectID", 0, "@PurchaseTime", 1398784884, "@ExpireTime", -1, "@Energy", 2400))
                {
                    cmd.ExecuteNonQuery();
                }
                using (var cmd = BuildQuery(con,
                    "INSERT INTO account_inventory(AccountID, Category, SubCategory, ItemID, ProductID, EffectID, PurchaseTime, ExpireTime, Energy) VALUES(@AccountID, @Category, @SubCategory, @ItemID, @ProductID, @EffectID, @PurchaseTime, @ExpireTime, @Energy); SHOW TABLE STATUS LIKE 'account_inventory';",
                    "@AccountID", accID, "@Category", 2, "@SubCategory", 0, "@ItemID", 1, "@ProductID", 2, "@EffectID", 0, "@PurchaseTime", 1398785050, "@ExpireTime", -1, "@Energy",2400))
                {
                    cmd.ExecuteNonQuery();
                }
            }
        }
im using "insert into" successfully add specific items to player inventory in sql,but im encounter a new problem.the sql database has store the new items that i added ,but it didn't shows in the player inventory in game mode,i must log out to server selection and re-log in, now i can see the items refresh on the inventory list,so i guess the sql data information isn't sync with the server in realtime,so can anyone could help me modify the code to implement the function that i can see items in inventory not just in sql database after first time character created? thanks