ClientContext context = new ClientContext("Site URL");
Web site = context.Web;
var StudentList = site.Lists.GetByTitle(" Ext List Name");
CamlQuery camlQuery = new CamlQuery();
IQueryable<ListItem> termEmps = StudentList.GetItems(camlQuery);
IEnumerable<ListItem> externalList = context.LoadQuery(termEmps);
context.ExecuteQuery();
var studentListData = from term in externalList
select new
{
FULLNAME = term.FieldValues.ElementAt(1).Value.ToString(),
Employeeid = term.FieldValues.ElementAt(2).Value.ToString(),
SEPERATIONDATE = term.FieldValues.ElementAt(4).Value.ToString()
};
foreach (var empterm in studentListData)
{
//do your stuff
}
Web site = context.Web;
var StudentList = site.Lists.GetByTitle(" Ext List Name");
CamlQuery camlQuery = new CamlQuery();
IQueryable<ListItem> termEmps = StudentList.GetItems(camlQuery);
IEnumerable<ListItem> externalList = context.LoadQuery(termEmps);
context.ExecuteQuery();
var studentListData = from term in externalList
select new
{
FULLNAME = term.FieldValues.ElementAt(1).Value.ToString(),
Employeeid = term.FieldValues.ElementAt(2).Value.ToString(),
SEPERATIONDATE = term.FieldValues.ElementAt(4).Value.ToString()
};
foreach (var empterm in studentListData)
{
//do your stuff
}
No comments:
Post a Comment