如何删除navicat中的表c#

时间:2016-08-29 11:26:03

标签: c# sql navicat

我试着让这个表每12小时清空一次

我的代码:

#region Vote System
            if (DateTime.Now.Hour == 12 && DateTime.Now.Minute == 00 && DateTime.Now.Second == 00)
            {
                MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("votes", "delete", "1");
                cmd.Execute();

            }

            if (DateTime.Now.Hour == 23 && DateTime.Now.Minute == 59 && DateTime.Now.Second == 40)
            {
                MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("votes", "delete", "1");
                cmd.Execute();
            }

            #endregion 

我的控制台没有错误,我不知道为什么这段代码无效

0 个答案:

没有答案