一个很简单的登陆代码,大家帮我看一下哪里不对了。谢谢
SqlConnection newConn = new SqlConnection(@"Data Source=www-08a954c4a44\sqlexpress;Initial Catalog=library;Integrated Security=True");newConn.Open();这是对的
SqlCommand thisCommand = new SqlCommand("select count(*) from User where ManagerID=" + this.textBox1.Text + " and ManagerPassword=" + this.textBox2.Text, newConn);
SqlDataReader thisReader = thisCommand.ExecuteReader();这里运行不通过
if (thisReader.Read())是不是这样判断有没有返回值?
{
this.Visible = false;
Form mainForm = new Form1(this.textBox1.Text, "tech");
mainForm.ShowDialog();
this.Close();
}