c# - Get a List using its ID -


I'm trying to get a list using this ID, though it is not working and I Why can not run

This works without problems ...

 using  (sps ite site = new sps ite ("http://example.org/ Sites / specific / staffhandbook ")) SPWeb web = site. OpenWeb ()) {SPList List = Web. List ["document"]; // process ...}  

It should be, but is not it? Using

  (SPS ite site = new SPS ite ("http: / /example.org/sites/specific/staffhandbook")) (SPWeb web = site.OpenWeb ()) {SPList list = Web.Lists ["29540646-bcab-4beb-8a91-648c1f3178b8"]; // process ...}  

SPListCollection Is either a Int32 (an index), a string (name of the list), or guid (identifier), then the above, you do Required:

  Guid Guid = New Good ("29540646-bcab-4beb-8a91-648c1f3178b8"); SPList list = web.Lists [guid];  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -