主题:[讨论]小问题急,高手帮一下
SqlConnection myconnection = new SqlConnection("server=FISH;database=yang;uid=sa;pwd=yang;");
myconnection.Open();
String SqlConn = "select * from users where UserID=" + "'" + username.Text + "'";
SqlCommand mycommand = new SqlCommand(SqlConn, myconnection);
SqlDataReader myreader = mycommand.ExecuteReader();
myreader.Read();
if (myreader["Pwd"].ToString()==password1.Text)
{....}
为什么if里进不去啊!if是只能用bool类型的,可是我就是不知道怎么办了!
myconnection.Open();
String SqlConn = "select * from users where UserID=" + "'" + username.Text + "'";
SqlCommand mycommand = new SqlCommand(SqlConn, myconnection);
SqlDataReader myreader = mycommand.ExecuteReader();
myreader.Read();
if (myreader["Pwd"].ToString()==password1.Text)
{....}
为什么if里进不去啊!if是只能用bool类型的,可是我就是不知道怎么办了!