怎么进不去循环?
private void button1_Click(object sender, System.EventArgs e){
if (this.textBox1.Text.ToString().Trim()==""||this.textBox2.Text.ToString().Trim()=="")
{
MessageBox.Show("请输入用户名和密码","提示");
}
else
{
for (int i=0;i<this.dataSet11.Tables[1].Rows.Count;i++)
{
this.sqlDataAdapter1.Fill(dataSet11);
this.myrow=this.dataSet11.Tables[1].Rows[i];
if (myrow[0].ToString().Trim()==this.textBox1.Text.ToString().Trim()&& myrow[4].ToString().Trim()==this.textBox2.Text.ToString().Trim())
{
canlogin=true;
user=this.textBox1.Text.ToString().Trim();
department=myrow[1].ToString().Trim();
this.Close();
return;
}
else
{
MessageBox.Show("密码或者用户名不正确!","提示");
}
}
}
}
这个表里明明有内容。可是为什么连for 循环都进不去??