帮我看下哪有错
存储过程:ALTER PROCEDURE App_Customers_Login
@Email nvarchar(128),
@Password nvarchar(32)
AS
Select CustomerID
From Customers
where Email = @Email and Password = @Password
RETURN
按扭点击事件: protected void btnRegister_Click(object sender, EventArgs e)
{
DataSet ds = Customer.Login(this.txtEmail.Text,this.txtPwd.Text);
if (ds == null)
{
this.LabelError.Visible = true;
return;
}
else
{
Session[ "CustomerID "] = (int)ds.Tables[0].Rows[0][0];
Response.Redirect( "CustomerInfo.aspx ");
}
}
Login函数:
public static DataSet Login(string Email,string Password)
{
try
{
SqlParameter[] par = new SqlParameter[2];
par[0] = new SqlParameter( "@Mail ", SqlDbType.NVarChar, 64);
par[0].Value = Email;
par[1] = new SqlParameter( "@Password ", SqlDbType.NVarChar, 32);
par[1].Value = Password;
return ExecuteSql4Ds( "App_Customers_Login ", par);
}
catch
{
return null;
}
}
运行没错,但输入正确信息,还是报用户名或密码错
ExecuteSql4Ds是自己写的方法,和数据想关的
------解决方案------------------