Advertisement
Guest User

Untitled

a guest
Feb 11th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using (SPSite siteCol = new SPSite("http://mySharepoint/"))
  2. {
  3. using (SPWeb web = siteCol.RootWeb)
  4. {
  5. SPList list = web.GetList("/Lists/PermissionMatrix");
  6.  
  7. SPListItem item = list.GetItemByIdSelectedFields([*Requires ID*], "Role");
  8.  
  9. String role1= (String)item["Roles"];
  10. }
  11. }
  12.  
  13. var sampleQuery = new SPQuery();
  14. sampleQuery.Query = @"<Where>
  15. <And>
  16. <FieldRef Name='Status' />
  17. <Value Type='Text'>Completed</Value>
  18. </And>
  19. <Gt>
  20. <FieldRef Name='Id' />
  21. <Value Type='Number'>20</Value>
  22. </Gt>
  23. </Where>";
  24. var foundItems = list.GetItems(sampleQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement