Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to retrieve let's say the title field of my item so what's the différence between doing these acces methods :

SPList myList = properties.List;
       string mytitle1 = myList.Items[0]["Title"];
       string mytitle2 = myList.Items[0].Fields["Title"];
       string mytitle3 = myList.Items[0].Fields.GetField("Title");
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Item[] returns the content of the field in item
Item.Fields[] returns metadata about the field and not the value

share|improve this answer
1  
how about Item.Fields.GetField("Title") ? –  Glolita Oct 16 '12 at 13:55
    
It returns metadata like Item.Fields[] the difference is that Item.Fields[] only does lookup by DisplayName, where Item.Fields.GetField() does it by InternalName, DisplayName, StaticName in that order –  Per Jakobsen Oct 16 '12 at 16:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.