为什么旧数据不能登陆?
protected void Button1_Click1(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings[ "Conectionstring "]);
SqlCommand cmd = new SqlCommand( "select * from yonghu where name= ' " + TextBox1.Text + " ' ", conn);
try
{
conn.Open();
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read())
{
if(sdr[ "password "].ToString()==TextBox2.Text.ToString())
{
conn.Close();
Session[ "ID "] = TextBox1.Text.Trim();
Response.Redirect( "~/Hello.aspx ");
}
else
{
Response.Write( " <script language=javascript> alert( '密码吆~! ') </script> ");
}
}
else
{