我想根据身份证号和QQ号找回密码,写完查询语句后,我怎么判断用户输入的和数据库的一样??求怎么写??
怎么写,具体的?

解决方案 »

  1.   

    怎么写if判断句啊?怎么判断用户输入的和数据库的一样?
      private void btnOk_Click_1(object sender, EventArgs e)
            {
               
                db.ConnOpen();
                   string sql = string.Format(@"select QQPwd,IDCard from dbo.Users
                            where QQPwd='{0} and IDCard='{1}", txtCard.Text.Trim(), txtQQid.Text.Trim());
                   int result = Convert.ToInt32(db.ExecuteNonQuery(sql));
                   if ()
                   {
                       
                   }
                 
      

  2.   

    string sql = string.Format(@"select count(*) from dbo.Users
      where QQPwd='{0} and IDCard='{1}", txtCard.Text.Trim(), txtQQid.Text.Trim());
      int result = Convert.ToInt32(db.ExecuteNonQuery(sql));
      if (result > 0)
      {
        存在
      }