数据路验证用户和密码报错

Select LoginId, LoginPwd, UserName, IsDisable, IsSuperUser, LastLoginTime from SysAdmins Where LoginId=txtLoginId And LoginPwd=txtLoginpwd

txtLoginId 和txtLoginpwd 提示 列名无效。
点击登录后 系统报错 不支持关键字 passwork。

不知道哪里出问题了。

应该获取控制的Text属性值(就是输入的内容),而且要用引号扩起值,


string sql="Select LoginId, LoginPwd, UserName, IsDisable, IsSuperUser, LastLoginTime from SysAdmins Where LoginId='"+txtLoginId.Text+"' And LoginPwd='"+txtLoginpwd+"'";
//执行上面的SQL语句

img


有其他问题可以继续交流~

txtLoginId 和txtLoginpwd应该是控件名称,不是文本内容吧。

App配置写错了