SPSite site = new SPSite("http://localhost"); SPWeb web = site.OpenWeb(); SPList item = web.Lists["Friends"]; SPQuery spQuery = new SPQuery(); spQuery.Query = ""; SPListItemCollection ListItems = item.GetItems(spQuery); foreach (SPListItem items in ListItems) { Response.Write((items["Name"].ToString()) + " " + " Senthil
"); } }
Sunday, November 21, 2010
SPQuery Value retreiving
Monday, November 08, 2010
UserProfileManager - Webservice in Sharepoint
Listing all domain users in Sharepoint 2007 using UserProfileManager webservice class.
First create the proxy class using wsdl or add webreference from Visual Studio.
The main difference in using webservice method is any user can access the resources within default network credentials.
But Sharepoint object model lets you use only with in production server with administrative privileges.
First create the proxy class using wsdl or add webreference from Visual Studio.
The main difference in using webservice method is any user can access the resources within default network credentials.
But Sharepoint object model lets you use only with in production server with administrative privileges.
localhost.UserProfileService service = new localhost.UserProfileService(); service.Credentials = System.Net.CredentialCache.DefaultCredentials; int a = (int)service.GetUserProfileCount(); for (int i = 0; i < a; i++) { Response.Write(service.GetUserProfileByIndex(i).UserProfile[1].Values[0].Value); }
Subscribe to:
Posts (Atom)