protected void btnLogin_Click(object sender, EventArgs e)
{
Property objproperty = new Property();
objproperty.Username = txtusername.Text.Trim();
objproperty.Password = txtpassword.Text.Trim();
IDataReader rdr = objadd.login(objproperty);
while(rdr.Read())
{
Session["Userid"] =rdr["UserId"].ToString();
Response.Redirect("Default.aspx");
rdr.Dispose();
}
}
异常详细信息:System.IndexOutOfRangeException:UserId
在 rdr["UserId"] 它显示上述错误
我无法解决这个问题请帮助我