SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my visual webpart, I want to get an item by it's id from a document library, and change it's field value. I don't want to actually read any of its field values, so I was wondering is there is a way to get an item by its id, and use a viewfields caml query to say, get this item without any fields.

Is this possible?


share|improve this question
up vote 2 down vote accepted

You can use the method GetItemByIdSelectedFields,

This method allows you to send as parameters the fields you want to receive

share|improve this answer

I don't think so. You better write a proper CAML query and specify the ID field on the Where clause.

share|improve this answer

What's wrong with the in-built SPList method for fetching the item by it's unique ID?

If it loads the default SPListItem fields it shouldn't be a concern so long as you are accessing a single item.

share|improve this answer

Your Answer


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.