主题:[讨论]急...大家进来帮我一下
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类型的,可是我就是不知道怎么办了!