编译器错误信息: CS0246: 找不到类型或命名空间名称“Parameters”(是否缺少 using 指令或程序集引用?) 5
protectedvoidImageLogin_Click(objectsender,ImageClickEventArgse){stringstrConn="serve...
protected void ImageLogin_Click(object sender, ImageClickEventArgs e)
{
string strConn = "server=localhost;database=SCDB;uid=a;pwd=123;";
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
string sql = "SELECT * FROM AdminInfo WHERE AdminNum=@UserName AND Password=@UserPwd";
SqlCommand cmd = new SqlCommand("insert into AdminInfo value(@UserName,@UserPwd)", conn);
Parameters para = new Parameter("@UserName", SqlDbType.Int, 4);
para.Value = UserId.Test;
cmd.Parameters.Add(para);
Parameters para = new Parameter("@UserPwd", SqlDbType.VarChar, 50);
para.Value = UserPwd.Test;
cmd.Parameters.Add(para);
SqlDataReader dr=cmd.ExecuteReader();
if (Option.DataCheck(sql))
{
Session["Login"] = UserId.Text.Trim()+","+GetRightsByUserID(UserId.Text.Trim());
Response.Redirect("Manage.aspx");
}
else
{
Response.Write("<script>alert('您的输入有误,请重新输入!');</script>");
};
} 展开
{
string strConn = "server=localhost;database=SCDB;uid=a;pwd=123;";
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
string sql = "SELECT * FROM AdminInfo WHERE AdminNum=@UserName AND Password=@UserPwd";
SqlCommand cmd = new SqlCommand("insert into AdminInfo value(@UserName,@UserPwd)", conn);
Parameters para = new Parameter("@UserName", SqlDbType.Int, 4);
para.Value = UserId.Test;
cmd.Parameters.Add(para);
Parameters para = new Parameter("@UserPwd", SqlDbType.VarChar, 50);
para.Value = UserPwd.Test;
cmd.Parameters.Add(para);
SqlDataReader dr=cmd.ExecuteReader();
if (Option.DataCheck(sql))
{
Session["Login"] = UserId.Text.Trim()+","+GetRightsByUserID(UserId.Text.Trim());
Response.Redirect("Manage.aspx");
}
else
{
Response.Write("<script>alert('您的输入有误,请重新输入!');</script>");
};
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询