SqlCommand cmd = new SqlCommand(" select count(*) from users where username = ' "+this.textBoxUserName.Text.ToString()+" 'and password =' "+this.textBoxUserPassword.Text.ToString()+" ' ",sqlconn);废话不多说,这句话大家应该一看就明白,好像不能完成想要的功能,我认为是单双引号的问题!!
调试欢乐多
SqlCommand cmd = new SqlCommand(" select count(*) from users where username = '"+this.textBoxUserName.Text.ToString()+"' and password ='"+this.textBoxUserPassword.Text.ToString()+"'",sqlconn);