Thursday, January 22, 2015

Apps In client Object Model

<div dir="ltr" style="text-align: left;" trbidi="on">

<div id="tabs-container">
    <ul class="tabs-menu">
        <li class="current"><a href="#tab-1">App Creation</a></li>
      
      
    </ul>
    <div class="tab">
        <div id="tab-1" class="tab-content">




    <u>App Creation</u><br/>
<pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%">
<code>

ClientContext clientContext = new ClientContext(siteUrl);
List oList = clientContext.Web.Lists.GetByTitle("Applist");
clientContext.Load(oList);
clientContext.ExecuteQuery();
if (oList != null)
{
ListItemCreationInformation listCreationInformation = new ListItemCreationInformation();
Microsoft.SharePoint.Client.ListItem oListItem = oList.AddItem(listCreationInformation);
// DataTable dt = new DataTable();
grdlist.DataSource = oListItem.GetDataTable();
//dt = bindToDataTable(items);
grdlist.DataBind();
}


<br /><br/></code>

</pre>
</div></div></div></div>

No comments:

Post a Comment