none
未将对象引用设置到对象的实例 RRS feed

  • 问题

  •         OdbcDataReader sdr = cmd.ExecuteReader();
            if (sdr.Read())
            {

                if (emaila == sdr["email"].ToString())
                {
                    int accid = Convert.ToInt32(sdr["id"]);
                    string passworld = GenerateCheckCode(10);//调用自定义方法生成一组字符串!
                    string passsql = "update account set sha_pass_hash=SHA1(CONCAT(UPPER('" + account.Text + "'),':','" + passworld + "')) where id='" + accid + "'";
                    mang.executeGetReturn(passsql);
                }

            }

    请问下我在DataReader里嵌套执行一句更新语句! 就提示未将对象引用设置到对象的实例。请教下如何解决这个问题呢!

    2010年3月19日 11:16

答案

全部回复