SPQuery represents a query in a list view.

learn more… | top users | synonyms

1
vote
4answers
5k views

Sharepoint 2010 SPQuery to join two custom lists

I have two custom lists. list 1 having following columns: ID (consider as PK) title list 2 having following columns NID (lookup column) title I'm using spquery.joins like below <Joins> ...
1
vote
1answer
2k views

filter items by Site name and List Name using SPSiteDataQuery

I am listing files from multiple folders using the below code: SPSiteDataQuery q = new SPSiteDataQuery(); q.Lists = "<Lists BaseType='1'/>"; q.Query = ...
1
vote
3answers
1k views

How do I programmatically alter sort and include columns in the “All Items” view?

How to programatically alter existing view "allitems.aspx" aka "All Items" to do an OrderBy (sort by first name and group by department) and only display first, last, m, date of birth, date of hire, ...
1
vote
0answers
318 views

SPSiteDataQuery without subfolder items?

I'm trying to use the SPSiteDataQuery to return the contents of several lists across a site collection. The problem I'm having, though, is that while there are only a few documents at the root level ...
1
vote
1answer
244 views

SPQuery - join two tables and count each

I have two tables with a 1-M connection and have not been able to correctly convert the following SQL into a caml/spQuery I want every value in table A once no matter what & table B divided into ...
1
vote
0answers
198 views

SPQuery on ECT very slow

I am creating a custom web part which is supposed to return results from an External Content Type(ECT) List which contains almost 40,000 records. There are multiple ways the items can be searched and ...
1
vote
0answers
124 views

How to display fields of parent list and foreign list using spquery

I have created parent list that lookup to another list . Both the list having one identical column label but different values(column name: displayorder).I projected the displayoreder column from ...
1
vote
0answers
536 views

Is there a simple way to add paging to ListViewByQuery ?

I'm working with a ListViewQuery component on a webpart and I need to add paging control to it. Is there a simple way to achieve that ? I saw somewhere than just setting the RowLimit property of ...
0
votes
4answers
6k views

Detected use of SPRequest for previously closed SPWeb object after SPQuery

this code run yesterday very well and today I've been trying to solve this error for hour now : Please close SPWeb objects when you are done with all objects obtained from them, but not before I ...
0
votes
2answers
2k views

How can use API to get all Publishing pages in the site collection using a specific Content Type?

I need to use API to return all Publishing pages using a specific content type in a publishing site. this includes querying all sites in the site collection. Can I do that with SPQuery? I am using ...
0
votes
2answers
4k views

SPQuery for Selecting/Excluding Hidden columns from a SPlist

I am trying to take a DataTable containing ID and other columns which are not hidden. I am doing this for a generic list which contains any number/type of columns. so I don't know the field names ...
0
votes
2answers
4k views

Error while trying to query the custom list sharepoint 2010

I am trying to query a custom list and getting the following error: At, SPListItemCollection OsplistitemCollection = Olist.GetItems(OqueryResponse); below is my code string TicketID = "123"; ...
0
votes
1answer
6k views

Get the SPListItems using SPList.GetItems(SPQuery)

I have a requirement of filtering the data from the SPList (ex:20000 SPListItems) and I bind it to the radgrid. I want to get first 200 and next 200 of every page click in the radgrid. This is my ...
0
votes
1answer
32 views

How get items in two subfolders?

I need get items from two different folders in a list on Sharepoint 2010, I already have the following code: SPList List = web.Lists["MyList"]; _titleFolderDispositivos = "firstfolder"; // ...
0
votes
1answer
861 views

SPDataSource for asp gridView returns nothing?

I'm binding my SPDataSource to an ASP:DataGrid but it returns empty gridview not filled. Here's my aspx file <SharePoint:SPDataSource runat="server" ID="SPTypes" DataSourceMode="ListItem" ...
0
votes
1answer
1k views

SPQuery works on ListViewByQuery but not with GetItems

In one of my webparts, I have a ListViewByQuery displaying some elements (or all) of a specified list. The SPQuery is built dynamically depending on the search fields. Here is how I build the ...
0
votes
2answers
147 views

How to query large list and retrieve one field of all items?

Image a list with i.e. 20.000 list items. All items have the field ContainerId (indexed). I now want to retrieve all ContainerIds to do other stuff with those. SPQuery is limited to a maximum of 2000 ...
0
votes
1answer
165 views

Performance : Caml query taking long time to load or something else

I have a CAML query which provides a result, if a SPfolder exists or not. When i do the item.Count it takes around 2sec for the line to execute . What is going wrong and taking long time to execute ...
0
votes
1answer
292 views

Powershell : Query Document Exclude Document Set

I have a Document Library contains multiple Document Sets, each of the Document Sets contains Files. Document Library ----> Document Set ----> Files My objective is to query all File Name only ...
0
votes
1answer
656 views

Which of these is the best way to get a list item collection?

Performance-wise which of these methods is the best way to get a list item collection, and why? SPList list = web.getlist("listurl"); SPListItemCollection items = list.getItems(query); ...
0
votes
2answers
878 views

Filter List for DateTime using CAML against Calculated Field

In WSS 3.0, I have a list with a Calculated Field, 'MaxDate'. It gets the greater of two other dates, Notional Date and Override Date. I am trying (and failing) to build a CAML query to get all items ...
0
votes
1answer
198 views

How to list all alements by CAML to SPGridView

Is it possible to display the listitems retrieved from a CAML query in a SPGridView? How can I implement it?
0
votes
2answers
619 views

SQQuery, Dates and Regional Settings

First, some setup: My Site is set to Eastern Time, and the server is located in Eastern Time. I'm trying to run a query against a list using the created date. I have tried using all variations I can ...
0
votes
1answer
4k views

How to set caml query for special view?

I have a list with 3 views. I want find special items of this. I use SPQuery for it. <Where> <Eq> <FieldRef Name='TypeTitle' /> <Value ...
0
votes
2answers
253 views

SharePoint list query efficiency

I'm trying to build a very high performance application on top of SharePoint 2010. One thing I'm having a hard time deciding is if I should make 2 list queries (1 small and 1 large) or if I should ...
0
votes
1answer
1k views

Join two list using multivalued lookup field with spquery

I have joined two lists with the lookup that allow single value using spquery.join. can any one help me to do for multivalue lookup
0
votes
0answers
7 views

Show all events ([today]) in Listview including “Recurring events”

I need a calender, which I can filter for events that take place [today]. The recurring events are not showing, when filtering for [today] and StartDate. Is it possible to have such a view with CAML ...
0
votes
1answer
30 views

GetItems Ignores ViewFields in Query

I have created the following method to fetch list items from a list. The method does return the right items, but no matter what I provide in the viewFields parameter, it always returns all fields. ...
0
votes
0answers
26 views

Restrict SharePoint Results

We want to restrict the shown subsites in our result search webpart to only the first subsite and not all subsites in the subsite. I try to explain it to you with a example... We have a Site ...
0
votes
0answers
35 views

List View Threshold error

I have a unique problem. I'm getting LVT error when running a script that displays every users' files that they have checked out across all libraries in a web scope in production. Here are a few ...
0
votes
1answer
108 views

GetListItemChangesSinceToken Folder Query option

I would like to get the list of folders and list items one level at a time, instead of querying all items under a SharePoint list. I plowed through SharePoint documentations and Stackoverflow and ...
0
votes
1answer
62 views

SharePoint 2010 Workflow Tasks SPQuery

I have a list item that gets triggered daily to send a workflow task. I created a web part to search based on different column values of the list item and the tasks. Currently: It goes through the ...
0
votes
1answer
464 views

How to get Single Record from Sharepoint Library when Items in library are more than List Threshold value?

I am trying to get single record from Large Sharepoint library using SPQuery/CamlQuery. The List View Threshold value and List View Threshold for auditors and administrators value is set to 2000. When ...
0
votes
1answer
338 views

How Does Calender List DateRangesOverlap <Today/>,<Month/>,<Year/> and <Week/> exactly work?

I have a SharePoint calendar list which has some recurring events i wanted a report of about last two years. Following is the code that i have written SPQuery qryBookings = new SPQuery(); ...
0
votes
1answer
90 views

SPQUERY returns null value

Hi im using sp query to retrieve the items and using projectproperty.Title to get the web name dynamically ,but I got empty value in this data table. q.ViewFields = "<FieldRef ...
0
votes
1answer
268 views

_ModerationStatus on list items is always draft from SPQuery

I am querying for list items in a timer job. The list has moderation enabled. It has various list items that have different approval status (e.g. scheduled, approved etc.). However the query always ...
0
votes
1answer
243 views

CAML query to select users IDs

I'm trying to select users ids from custom tasks lists. All users are in one SP Group and I need to collect users Ids that doesn't have tasks. query.Query = string.Format("<And><Membership ...
0
votes
1answer
34 views

quick way to access splistitem in different list?

I have 2 lists: listA and listB listA has 2 fields: Title (text) PortalID (text) listB has 3 fields: Title (text), listAField(lookup to listA Title field) UserID (text) I have a UserID value ...
0
votes
2answers
205 views

Dynamic SPQuery

I want to build search criteria by using SPQuery object that searches a list. On application page, there are two textbox Controls, 2 combobox Controls and 2 people picker Controls. The search criteria ...
0
votes
0answers
129 views

spquery.query cannot be charged correctly

I'm charging my spquery with different parameters from a static class called Fields : In fact I'm using this query to bind result data to my asp:grid view using (SPSite mySite = new ...