Home > SharePoint Development > How to retrieve and update the People and Group Field in Sharepoint using c#

How to retrieve and update the People and Group Field in Sharepoint using c#

This code will help to understand, how to get People and Group value and use it for different purpose.           

 using (SPSite site = new SPSite("http://URL"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.Lists["Shared Documents"];
                    SPListItemCollection itemCollection = list.Items;
                    foreach (SPListItem item in itemCollection)
                    {
                        SPFieldUserValue val = new SPFieldUserValue(web, item["Modified By"].ToString());
                    }
                }
            }
           

Advertisements
  1. 24/07/2015 at 11:29 am

    Reblogged this on Prasad's Blog.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: