Client object Model Using Silverlight in SharePoint (Getting Records From SharePoint List)
ClientContext context = new ClientContext(ApplicationContext.Current.Url);
context.Load(context.Web);
List Projects
= context.Web.Lists.GetByTitle("Opportunity
Financial Data");
context.Load(Projects);
CamlQuery query = new
Microsoft.SharePoint.Client.CamlQuery();
string startDateFx = FirstDate.ToString("yyyy-MM-dd");
string endDatFx = LastDate.ToString("yyyy-MM-dd");
camlQueryXml
= "<View><Query><Where><And><Geq><FieldRef
Name='Created' /><Value IncludeTimeValue='FALSE'
Type='DateTime'>" + startDateFx + "</Value></Geq><Leq><FieldRef
Name='Created' /><Value IncludeTimeValue='FALSE' Type='DateTime'>"
+ endDatFx + "</Value></Leq></And></Where></Query></View>";
query.ViewXml
= camlQueryXml;
_financialData
= Projects.GetItems(query);
context.Load(_financialData);
context.ExecuteQueryAsync(new
ClientRequestSucceededEventHandler(OnRequestSucceeded),
null);
///
private void
OnRequestSucceeded(Object sender, ClientRequestSucceededEventArgs args)
{
Dispatcher.BeginInvoke(BindData);
}
Comments
Post a Comment