Accessing SPListItem from SPListItemCollection directly

I have an SPList object and use SPList.Items to get SPListItemCollection. From this collection I need to access one SPListItem for which the UniqueID or GUID is not known. Is it possible to access the element directly using Display Name or any other information (other than GUID or UniqueId). Any idea would be appreciated.

+2


source to share


2 answers


Not out of the box - see the question How to access list items in a list box for parameters. Retrieving information with SPQuery is recommended to avoid overloading the database. More info on how to use this in SharePoint's answer : check if item exists in list, minimum overhead :



A good alternative is to use LINQ . This option was contributed by the community (Keith Dahlby and Wictor WilΓ©n) and is available in the SharePoint Extensions Lib .

+5


source


If you are going to use CAML, the CAML Query Builder will really help . Personally, I don't like doing CAML using plain old line, so I used CAML.NET to wrap CAML requests



0


source







All Articles