Last active
January 3, 2016 23:49
-
-
Save Na0mir/8537884 to your computer and use it in GitHub Desktop.
Get SharePoint item (SPListItem) using CAML from column's name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------- | |
// Author: Romain Blanchard | |
// Date: 21.01.2014 | |
// Description: Get SharePoint item (SPListItem) using CAML from column's name. | |
// ---------------------------------------------- | |
SPList Library = web.Lists[<ListName>]; | |
SPQuery ItemQuery = new SPQuery(); | |
ItemQuery.Query = "<Where><Eq><FieldRef Name=\"<ColumnName>\" /><Value Type='Text'>" + <Value> + "</Value></Eq></Where>"; | |
SPListItemCollection ListItemCollection = Library.GetItems(ItemQuery); | |
SPListItem item = ListItemCollection[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment