Client Object model is very powerful feature of Sharepoint 2010.
You can use Client object model from remote computer to access sharepoint site and do CRUD operation.
Below is the sample code to create listitem using Sharepoint client object model.
// Create ClientContext Object
using (ClientContext clientContext = new ClientContext("http://sitename"))
{
// Give the credential
clientContext.Credentials = new System.Net.NetworkCredential("username", "password", "domainname");
Web site = clientContext.Web;
List list = clientContext.Web.Lists.GetByTitle("ListName");
// To use site object load it first
clientContext.Load(site);
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem listItem = list.AddItem(itemCreateInfo);
listItem["Title"] = "Created through Client Object Model";
listItem.Update();
// Execute the query to push data on the server.
clientContext.ExecuteQuery();
}
Subscribe to:
Post Comments (Atom)
Query List/Document Library in Specific Folder
To query SharePoint List or Document Library in specific Folder “ FolderServerRelativeUrl ” as part of the CAML Query Code Snippet ...
-
#Add a sharepoint group using power shell #Create a sharepoint custom permission using Power shell $web = get-SPWeb "http://sitecollect...
-
I am very sure that most of the Sharepoint developers must have used _spBodyOnLoadFunctionNames to inject javascript methods on the sharepo...
-
This issue occurs when you do backup restore of the site/site collection. Due to this you can not see the page in design mode due to some re...
No comments:
Post a Comment