查询用户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();
}
//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();
}