不明白啊 ,呜呜.难呐
就按我刚才给你的那个就可以了
P.S:你也和我住同一个地方?
SqlConnection meteor = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["meteor"]); meteor.Open();//连数据库 SqlCommand comm = new SqlCommand("select * from studentlogin Where username=('" + TextBox1.Text.ToString().Trim() + "')", meteor); SqlDataReader dr = comm.ExecuteReader(); if (dr.Read()) { if (dr["password"]==this.TextBox2.Text.Tostring().Trim()) { Response.Write("<script language=javascript>alert('登陆成功!')</script>"); Response.Redirect("毕业生.aspx"); } else { Response.Write("<script>alert('密码错误!')</script>"); } } else Response.Write("<script language=javascript>alert('无此用户!')</script>"); dr.Close(); meteor.Close();