我的用的语句是
MyView.RowFilter = "state='no' and owner="+username ;
筛选出state为no的并且owner为username的行;username为变量
但是会报错,求教各位达人,正确的该怎么写
谢谢
MyView.RowFilter = "state='no' and owner="+username ;
筛选出state为no的并且owner为username的行;username为变量
但是会报错,求教各位达人,正确的该怎么写
谢谢
MyView.RowFilter = "state='no' and owner='"+username+"'"
如果不是的话,你就要检查程序了
可能你数据库的字段是字符串类型的,所以需要加上单引号。代码:MyView.RowFilter = "state='no' and owner='"+username+"'";