毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> net技术 >> 正文

运算符“&”无法应用于“bool”和“string”类型的操作数

更新时间:2012-11-8:  来源:毕业论文

登陆界面的用户名密码验证

CS0019: 运算符“&”无法应用于“bool”和“string”类型的操作数
用and好像也不行?


if (ds.Tables["t1"].Rows.Count ==1 & Login1.UserName = ds.Tables["t1"].Rows[0]["t1_username"].ToString() and  Login1.Password = ds.Tables["t1"].Rows[0]["t1_pwd"].ToString() )  

         {
        Response.Write("登陆成功!");     

        }
        else
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "alter", "<script>alert(\"请检查用户名或密码\");</script> ");

if (ds.Tables["t1"].Rows.Count>0)//先判断数毕业论文 据有没有在判断密码用户名是否匹配比较好
{
if( Login1.UserName = ds.Tables["t1"].Rows[0]["t1_username"].ToString() && Login1.Password = ds.Tables["t1"].Rows[0]["t1_pwd"].ToString())
{
}
}  

开始只看了第一个,后面也要改:
if (ds.Tables["t1"].Rows.Count ==1 && Login1.UserName == ds.Tables["t1"].Rows[0]["t1_username"].ToString() && Login1.Password == ds.Tables["t1"].Rows[0]["t1_pwd"].ToString() )

if (ds.Tables["t1"].Rows.Count ==1 && Login1.UserName == ds.Tables["t1"].Rows[0]["t1_username"].ToString() && Login1.Password == ds.Tables["t1"].Rows[0]["t1_pwd"].ToString() )   

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。