在default.aspx页面有以下的代码
private void loginrecord()
{
Jxllt.DBUtility.DbHelperSQL.ConnDataBase("jxtmsg", "");
SqlParameter[] list ={ new SqlParameter("@empid", SqlDbType.Int), new SqlParameter("@EmpCheckCode", SqlDbType.VarChar, 50), new SqlParameter("@Ret", SqlDbType.Int), new SqlParameter("@empRant",SqlDbType.Int) };
list[0].Value =Convert.ToInt32(this.txtEmpid.Text);
list[1].Value = Hid_code.Value.ToString();
list[2].Direction = ParameterDirection.Output;
list[3].Direction = ParameterDirection.Output;
Jxllt.DBUtility.DbHelperSQL.ExecRunProce("Qf_LoginRecord", list);
} protected void Btnlogin_Click(object sender, EventArgs e)
{
if (txtEmpid.Text.Trim().ToString() == "")
{
Response.Write("用户名不能为空!请输入正确的用户名");
}
else
{
try
{
Jxllt.DBUtility.DbHelperSQL.ConnDataBase("jxtmsg", "");
SqlParameter[] list ={
new SqlParameter("@Empid",SqlDbType.VarChar,12),
new SqlParameter("@msgcontent",SqlDbType.VarChar,100),
new SqlParameter("@Ret",SqlDbType.Int)
};
list[0].Value = this.txtEmpid.Text.Trim().ToString();
list[1].Value = this.GenerateCheckCode();
this.Hid_code.Value = list[1].Value.ToString();
list[2].Direction = ParameterDirection.Output;
Jxllt.DBUtility.DbHelperSQL.RunProcedure("Qf_Getcheckcode", list);
Session["Empid"] = this.txtEmpid.Text;
Session["checkcode"] = this.Hid_code.Value;
this.loginrecord();
Response.Write(list[2].Value);
Response.Write("<script>alert('验证码获取成功,请注意查收!');</script>");
Response.Redirect("Qf_login.aspx");
}
catch (System.NullReferenceException ee)
{
Response.Write(ee.Message);
}
}
}
我现在想把 list[3].Direction = ParameterDirection.Output;值传到另外一个页面去,这个应该怎么传,session["EmpRant"]=list["3"].value.tostring();
但是我在调用这个session时候发现没有值这是怎么回事,正常情况下,他应该能返回1,2,或者3,请问这个该怎么解决
private void loginrecord()
{
Jxllt.DBUtility.DbHelperSQL.ConnDataBase("jxtmsg", "");
SqlParameter[] list ={ new SqlParameter("@empid", SqlDbType.Int), new SqlParameter("@EmpCheckCode", SqlDbType.VarChar, 50), new SqlParameter("@Ret", SqlDbType.Int), new SqlParameter("@empRant",SqlDbType.Int) };
list[0].Value =Convert.ToInt32(this.txtEmpid.Text);
list[1].Value = Hid_code.Value.ToString();
list[2].Direction = ParameterDirection.Output;
list[3].Direction = ParameterDirection.Output;
Jxllt.DBUtility.DbHelperSQL.ExecRunProce("Qf_LoginRecord", list);
} protected void Btnlogin_Click(object sender, EventArgs e)
{
if (txtEmpid.Text.Trim().ToString() == "")
{
Response.Write("用户名不能为空!请输入正确的用户名");
}
else
{
try
{
Jxllt.DBUtility.DbHelperSQL.ConnDataBase("jxtmsg", "");
SqlParameter[] list ={
new SqlParameter("@Empid",SqlDbType.VarChar,12),
new SqlParameter("@msgcontent",SqlDbType.VarChar,100),
new SqlParameter("@Ret",SqlDbType.Int)
};
list[0].Value = this.txtEmpid.Text.Trim().ToString();
list[1].Value = this.GenerateCheckCode();
this.Hid_code.Value = list[1].Value.ToString();
list[2].Direction = ParameterDirection.Output;
Jxllt.DBUtility.DbHelperSQL.RunProcedure("Qf_Getcheckcode", list);
Session["Empid"] = this.txtEmpid.Text;
Session["checkcode"] = this.Hid_code.Value;
this.loginrecord();
Response.Write(list[2].Value);
Response.Write("<script>alert('验证码获取成功,请注意查收!');</script>");
Response.Redirect("Qf_login.aspx");
}
catch (System.NullReferenceException ee)
{
Response.Write(ee.Message);
}
}
}
我现在想把 list[3].Direction = ParameterDirection.Output;值传到另外一个页面去,这个应该怎么传,session["EmpRant"]=list["3"].value.tostring();
但是我在调用这个session时候发现没有值这是怎么回事,正常情况下,他应该能返回1,2,或者3,请问这个该怎么解决
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货