一个C#问题,请各位多多赐教
this.sqlDataAdapter1.Fill(this.dataSet11);
System.Data.DataRow tempRow = null;
tempRow = this.dataSet11.Tables["users"].Rows.Find(this.Text_name.Text);
if(tempRow != null&&this.Text_password.Text==tempRow["password"].ToString())
{
Label3.Text="login successful";
}
else
Label3.Text="Login failed!";
其中Text_name,Text_password是两个TextBox控件,users表有两列name(char型),password(char型)
我是想实现用户登陆的功能,
如果该用户名在表中并且password真确时Label3显示"login successful"
可是我在输入用户名和password都正确的时候Label3也还是显示的是"Login failed!"
难道是我的if语句的条件有错误吗?
我不知道,还请各位大虾不吝赐教,先谢谢各位了