开发者

SPDataSource filtering error

开发者 https://www.devze.com 2023-04-03 07:48 出处:网络
Does anyone have an idea why the following code doesn\'t work? 开发者_如何学JAVA SPDataSource source = new SPDataSource();

Does anyone have an idea why the following code doesn't work?

开发者_如何学JAVA
    SPDataSource source = new SPDataSource();
    source.List = list;
    source.SelectCommand = "<Query><Where><Eq><FieldRef Name='Person' LookupId='TRUE' /><Value Type='Integer'>" + currentUser.ID + "</Value></Eq></Where></Query>";
    gridView.DataSource = source;
    gridView.DataBind(); // <- Breaks here

Basically I am trying to filter the list for the current user and only display the items that have his name in the "Person" field. Also, it works without the SelectCommand, so I assume my query is wrong, but do not understand why it fails. I tried declaring value type as user and assigning it currentUser.Name, but it also failed.


Your error means that either your field name or datatype is invalid.

0

精彩评论

暂无评论...
验证码 换一张
取 消