解决方案 »

  1.   

    把你操作mysql的代码贴出来看啊
      

  2.   

     /// <summary>
            /// 向MySql数据库更新数据
            /// </summary>
            /// <param name="parkType">映射表的对象</param>
            /// <returns></returns>
            public int Update(string sql)
            {
                // 插入数据到MySql数据库
                Console.WriteLine("向MySql中更新一条数据 ...");
                MySqlCommand cmd = new MySqlCommand(sql, this.mySqlConn);//声明执行sql文本或存储过程的对象
                int row = cmd.ExecuteNonQuery();
                this.Close();
                return row;// 执行后返回影响的结果行数
            }
      

  3.   

    关键是那个this.mySqlConn是什么sql语句。这方法,把全局变量用进来而不是参数。
      

  4.   

    我想和这个是无关的,真正的原因应该出现在多线程操作MySQL的原因,目前正在逐一排除。一位外国友友是这样回答的。我正在核实。Hi Adil,This seems similar to issue: http://bugs.mysql.com/bug.php?id=57365The workaround then was to customize the net_xxx_timeout settings.
    For example, issue the following after openning your connection and
    before executing the datareader:MySqlCommand cmd = new MySqlCommand(
      "set net_write_timeout=99999; set net_read_timeout=99999", con );
    cmd.ExecuteNonQuery();Let us know if that solves the prb.
      

  5.   

    两个可能,一个表锁了,第二个那条数据别人正在操作可以考虑加个 for update。
      

  6.   

    你这个可能是连接打开关闭的原因你这个方法里面有Close()那你的sqlConn的Open()方法呢?在什么时候调用的
    打开和关闭是否对应?