当前位置: 代码迷 >> ASP.NET >> 这样判断有没有记录不对么?解决方法
  详细解决方案

这样判断有没有记录不对么?解决方法

热度:2663   发布时间:2013-02-26 00:00:00.0
这样判断有没有记录不对么?
public   static   int   LandingConfirmation(string   username,string   userpassword)      
        {
                sqlstr   =   "select   top   1   *   from   manager   where   account= ' "   +   username   +   " '   and   pwd= ' "   +   userpassword+ " ' ";
                read=Data.operator_selectonlyread(sqlstr);
                if   (read.HasRows==true)  
                {
                        HttpContext.Current.Session[ "account "]   =   read.GetName(1);
                        result   =   1;//查询到帐号信息
                }
                else
                {
                        result   =   0;//没有查询到帐号信息
                }
                return   result;
        }


                read=Data.operator_selectonlyread(sqlstr);     //获取一个方法
                if   (read.HasRows==true)       这样判断有没有数据不对么   ?

------解决方案--------------------------------------------------------
你这个代码有注入漏洞哦

  相关解决方案