http://www.sharepointdev.net/sharepoint--development-programming/get-user-profile-using-display-name-in-sharepoint-51923.shtml
http://msdn.microsoft.com/en-us/library/microsoft.office.server.servercontext.aspx
http://karinebosch.wordpress.com/sharepoint-controls/peopleeditor-control/
http://simplesharepointsolutions.blogspot.com/2009/06/how-to-populate-custom-contact-list.html
Providing the fact that your user column only accepts users (not groups) and only a single value :
using (SPSite Site = new SPSite("yoursite"))
{
using (SPWeb Web = Site.OpenWeb())
{
SPListItem Itm = Web.Lists["TheList"].GetItemById(1);
SPFieldUserValue UserValue = new SPFieldUserValue(Web,Itm["UserCol"].ToString());
Console.WriteLine(string.Format("Email : {0}\r\nLogin :{1}",
UserValue.User.Email,
UserValue.User.LoginName));
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment