日期:2014-05-19  浏览次数:20803 次

帮忙看看如何实现!!!
if(dr.Read())
{
if(TextBox1.Text==dr[ "name "]&&TextBox2.Text==dr[ "password "].ToString())

{
          
Response.Write( " <script> alert( '登陆成功! ') </script> ");
                     //dr.Close();
}
else
{
Response.Write( " <script> alert( '用户或密码错误! ') </script> ");
}


dr.Close();
conn.Close();

------解决方案--------------------
if(dr.Read())
{
if(TextBox1.Text.ToString().Trim()==dr[ "name "].ToString().Trim()&&TextBox2.Text.ToString().Trim()==dr[ "password "].ToString().Trim())

{
          
Response.Write( " <script> alert( '登陆成功! ') </script> ");
   //dr.Close();
}
else
{
Response.Write( " <script> alert( '用户或密码错误! ') </script> ");
}


dr.Close();
conn.Close();

------解决方案--------------------
textbox1.text==dr[ "name "].tostring().trim();
textbox2.text==dr[ "password "].tostring().trim();