• membership access提供程序更改密码错误问题?


    这是我用的membership提供程序里的的一个方法,为什么改密码时一直报错,我用vs设了断点
    说是update的语句有错误,大家帮我看看,谢谢!
    OleDbConnection conn = new OleDbConnection(connectionString);
                OleDbCommand cmd = new OleDbCommand("UPDATE [" + tableName + "]" +
                        " SET Password = ?, LastPasswordChangedDate = ? " +
                        " WHERE Username = ? AND ApplicationName = ?", conn);

                cmd.Parameters.Add("@Password", OleDbType.VarChar, 255).Value = EncodePassword(newPwd);
                cmd.Parameters.Add("@LastPasswordChangedDate", OleDbType.DBDate).Value = DateTime.Now;
                cmd.Parameters.Add("@Username", OleDbType.VarChar, 255).Value = username;
                cmd.Parameters.Add("@ApplicationName", OleDbType.VarChar, 255).Value = pApplicationName;


                int rowsAffected = 0;

                try
                {
                    conn.Open();

                    rowsAffected = cmd.ExecuteNonQuery();  //调试时说错误出在这里
                }
                catch (OleDbException e)
                {
                    if (WriteExceptionsToEventLog)
                    {
                        WriteToEventLog(e, "ChangePassword");

                        throw new ProviderException(exceptionMessage + "1");
                    }
                    else
                    {
                        throw e;
                    }
                }

  • 相关阅读:
    BestCoder Round #61 (div.2)
    CCPC L(水)
    CCPC A(模拟)
    暗网是什么?如何进入暗网?
    社会工程学:关于一些信息收集的网站
    Flask开发系列之Web表单
    Flask开发系列之模板
    [转]Python 资源大全中文版
    python字符串/列表/字典互相转换
    Flask开发系列之Flask+redis实现IP代理池
  • 原文地址:https://www.cnblogs.com/ddr888/p/583014.html
Copyright © 2020-2023  润新知