查询用户CAML

SPQuery query = new SPQuery();
                          //SPFieldMultiLineText text = (SPFieldMultiLineText)web.SiteUserInfoList.Fields[SPBuiltInFieldId.Notes];
                          query.Query = "<Where><And><Eq><FieldRef Name='IsGroup'/><Value Type='Text'>职责</Value></Eq><Eq><FieldRef Name='IsEnable'/><Value Type='Text'>是</Value></Eq></And></Where>";
                          SPList spList = web.Lists["用户信息列表"];
                          DataTable dt = spList.GetItems(query).GetDataTable();
                          if (dt != null)
                          {
                              cbxRole.DataSource = dt;
                              cbxRole.DataTextField = "Title";
                              cbxRole.DataValueField = "ID";
                              cbxRole.DataBind();
                          }
posted @ 2011-05-12 14:11  Jason.Bird  阅读(180)  评论(0编辑  收藏  举报