本帖最后由 chyude 于 2011-08-02 16:35:12 编辑

解决方案 »

  1.   

    这种问题,只有自己调试了,设个断点,看看空数据时,CommandText 值是什么,拷贝到查询分析器里执行,看看会有什么结果。
      

  2.   

    Command.CommandText = PublicLibrary.CHARSET_STRING + Command.CommandText;你调试的时候看看这个值是什么??
      

  3.   

     Command.CommandText  的内容你跟踪一下,我看了前面感觉你在用视图,对不
      

  4.   

    protected static MySqlDataAdapter CreateAdapter(MySqlCommand myCommand, MySqlConnection dbConnection)
            {
                MySqlDataAdapter testAdapter = new MySqlDataAdapter(myCommand);
                MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(testAdapter);
                testAdapter.SelectCommand.Connection = dbConnection;
                return testAdapter;
            }
      

  5.   

    打个断点跟一下,看看Command.CommandText 得到的值是啥,一步一步的进去调试。我刚写程序的时候一出问题,要么找人帮忙看,要么乱猜一通,自己学会调试后出现错误,就自己调,基本不怎么麻烦别人了,呵呵
      

  6.   

    你的comand和connection都没有关联吧
      

  7.   

    Command需要设置他的查询字符串和连接对象Connection,构造函数就已经告诉你了。是不是这个问题试试
      

  8.   

    SqlConnection con = new SqlConnection("");
                SqlCommand com = new SqlCommand("", con);借鉴,希望有帮助
      

  9.   

    protected static MySqlDataAdapter CreateAdapter(MySqlCommand myCommand, MySqlConnection dbConnection)
      {
      MySqlDataAdapter testAdapter = new MySqlDataAdapter(myCommand);
      MySqlCommandBuilder myCommandBuilder = new MySqlCommandBuilder(testAdapter);
      testAdapter.SelectCommand.Connection = dbConnection;
      return testAdapter;
      }