Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (SPSite siteCol = new SPSite("http://mySharepoint/"))
- {
- using (SPWeb web = siteCol.RootWeb)
- {
- SPList list = web.GetList("/Lists/PermissionMatrix");
- SPListItem item = list.GetItemByIdSelectedFields([*Requires ID*], "Role");
- String role1= (String)item["Roles"];
- }
- }
- var sampleQuery = new SPQuery();
- sampleQuery.Query = @"<Where>
- <And>
- <FieldRef Name='Status' />
- <Value Type='Text'>Completed</Value>
- </And>
- <Gt>
- <FieldRef Name='Id' />
- <Value Type='Number'>20</Value>
- </Gt>
- </Where>";
- var foundItems = list.GetItems(sampleQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement