SHARE
TWEET

Untitled

a guest Feb 11th, 2013 30 Never
  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);
RAW Paste Data
Top