先学习创建表与遍历库中表集合的sql语句,再在你的代码中去执行这些sql。

解决方案 »

  1.   

    遍历库中表的集合,方法很多,我选了几种,都有错误,你帮我看看有什么好的方法?
      string str_selct = "select " + YMD + " from INFORMATION_SCHEMA.TABLES  where TABLE_SCHEMA='mydesin' ;
                MySqlCommand cmd = new MySqlCommand(str_selct, Con);                     int result = Convert.ToInt32(cmd.ExecuteScalar());
                if (result == 0)
                {
                    flag = false;            }
    else
    {
    flag = true;}mydesin是我的数据库名,YMD是今天的日期,