日期:2014-05-18  浏览次数:20417 次

求一个存储过程,谢谢。有代码在此
我实在是没办法了,自己写了一个,但是在SQL手动执行就可以,到了网页上调试就是注册失败。
麻烦帮忙看看存储过程怎么改。。。
一楼是CS的代码,二楼是存储过程的代码


C# code

public bool ProcessRequest(string UserName, string PassWord, int Sex, int Age, string Birthday, string TrueId, string Email, out string Msg)
        {
            Msg = "";
            string str = "";
            string str2 = "";
            string str3 = "";
            string str4 = "";
            string str5 = "";
            string str6 = "";
            if ((UserName != null) && (UserName.Trim() != ""))
            {
                str = Utility.replaceSingleQuotes(UserName.Trim());
            }
            if ((PassWord != null) && (PassWord.Trim() != ""))
            {
                str2 = Utility.replaceSingleQuotes(PassWord.Trim());
            }
            if ((Birthday != null) && (Birthday.Trim() != ""))
            {
                str3 = Utility.replaceSingleQuotes(Birthday.Trim());
            }
            if ((TrueId != null) && (TrueId.Trim() != ""))
            {
                str4 = Utility.replaceSingleQuotes(TrueId.Trim());
            }
            if ((Email != null) && (Email.Trim() != ""))
            {
                str5 = Utility.replaceSingleQuotes(Email.Trim());
            }
            if (((((str != "") && (str2 != "")) && ((str3 != "") && (str4 != ""))) && (str5 != "")) && (Sex <= 1))
            {
                if (new Utility().VipTrue())
                {
                    SqlParameter[] params = new SqlParameter[10];
                    params[0] = new SqlParameter("@strGameAccount", SqlDbType.NVarChar, 0x20);
                    params[0].set_Value(str);
                    params[1] = new SqlParameter("@strGamePWD", SqlDbType.NVarChar, 0x20);
                    params[1].set_Value(str2);
                    params[2] = new SqlParameter("@strTjUser", SqlDbType.NVarChar, 0x20);
                    params[2].set_Value(str6);
                    params[3] = new SqlParameter("@strSex", SqlDbType.Int, 4);
                    params[3].set_Value(Sex);
                    params[4] = new SqlParameter("@strage", SqlDbType.Int, 4);
                    params[4].set_Value(Age);
                    params[5] = new SqlParameter("@strBirthday", SqlDbType.NVarChar, 0x20);
                    params[5].set_Value(str3);
                    params[6] = new SqlParameter("@strTrueId", SqlDbType.NVarChar, 0x20);
                    params[6].set_Value(str4);
                    params[7] = new SqlParameter("@strEmail", SqlDbType.NVarChar, 0x20);
                    params[7].set_Value(str5);
                    params[8] = new SqlParameter("@strErrInfo", SqlDbType.NVarChar, 0x200);
                    params[8].set_Value("");
                    params[8].set_Direction(ParameterDirection.Output);
                    params[9] = new SqlParameter("@return", SqlDbType.Int, 4);
                    params[9].set_Value(0);
                    params[9].set_Direction(ParameterDirection.ReturnValue);
                    if (this.dbWrapper.ExecuteStoredProcedure("AC_sp_CreateAccount", params) == 0)
                    {
                        if (int.Parse(params[9].get_Value().ToString()) == 1)
                        {
                            Msg = "恭喜註冊成功!";
                            return true;
                        }
                        Msg = params[9].get_Value().ToString();
                        return false;
                    }