Menu
Most of case we use CAML Query in sharepoint to filter splist data for custom development. But some time it’s difficult to filter list data using CAML query. So, we can use LINQ in our development practice.
CAML Query Tutorial In this video you will see how to create a simple webpart that receives CAML query from user and shows the results on the SharePoint page. 6 SQL Query Interview Questions.
SPWeb spWeb = newSPSite(SPContext.Current.Web.Url).OpenWeb()
//Get list
SPList list = spWeb.Lists.TryGetList('MyList');
//Apply linq in list item
List<SPListItem> total = (fromSPListItem item in list.Items
whereConvert.ToDateTime(item['VisitedDate'])>= startDate
&& Convert.ToDateTime(item['VisitedDate']) <= endDate
select item).ToList();
//Apply linq in list item after CAML query
SPQuery oPostQuery = newSPQuery();
oPostQuery.Query = string.Concat('<Where><Eq><FieldRef Name='FeedbackQuery'/><Value Type='Lookup'>' + filterItem + '</Value></Eq></Where>');
List<SPListItem> total = (fromSPListItem item in list.GetItems(oPostQuery)
whereConvert.ToDateTime(item['VisitedDate'])>= startDate
&& Convert.ToDateTime(item['VisitedDate']) <= endDate
select item).ToList();
Posted on Thursday, June 6, 2013 9:54 AM SharePoint | Back to topThis is an end to end.NET Interview preparation kit especially made from interview preparation. It covers all possible interview questions from basic.NET, new. Project Description. NET simplifies creating of CAML queries for Windows Share. When you have a large number of items in a list and you.
Starting With CAML Builder Go to Start, All Programs, U2U Training nv, then U2U CAML Query Builder. The following screen will appear. Enter your online SharePoint site URL. Select “ Connect to SharePoint Online” and also select “ Custom Credentials”. Enter the username and password for SharePoint Online site. Click Connect button.
The following screen will appear. Select your list name. Here I have selected “ MyList”. Click New query, then Simple Query. The following screen will appear.
Select your column name in second drop down list. Here I have query based on location column name. Click Execute query. The results will show as in the following. Query with View Fields, Click New query, then Query with ViewFields. First select your queried column name. Here I have selected location column name.