SPQuery represents a query in a list view.

learn more… | top users | synonyms

2
votes
1answer
984 views

Getting User details from field “AssignedTo” in a custom List

I have a Custom List, which have different fields, when I click on any user in field "assignedTo" it navigates me to another window and I can see user's Account, Name, email etc. I am able to get all ...
0
votes
2answers
225 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
2answers
3k 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
1answer
888 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
1
vote
1answer
310 views

Is it possible to use spquery in WCF for sharepoint

I created custom wcf that retrieve items from the list. Is it possible to use spquery within the wcf to filter the list items
1
vote
0answers
116 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 ...
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 ...
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
0answers
1k views

ProjectedFields working in SPQuery but not in the View

I've three lists: Competitions, Works and WorksVotes, linked to each other through Lookup fields. WorksVotes list has Lookup field to Works list, and Works list has Lookup field to Competitions list. ...
1
vote
0answers
423 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
2answers
3k 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
955 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 ...
5
votes
1answer
2k views

Is it possible to return only the count of the query?

Is there any way to return only the count of the rows from a Sharepoint query? I would like to get only the count of the result returned by sharepoint query.
2
votes
0answers
2k views

How to get the particular columns from a SharePoint list view

I am using SPQuery to fetch data (particular columns from the list based on viewID) from SharePoint list. Here is the code for fetching the data: SPQuery sQuery = new SPQuery(); currentlistview = ...
0
votes
1answer
5k 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 ...
1
vote
3answers
708 views

is this causing memory leaks?

I have a couple of utility functions that help with querying lists and wanted to see if they I wrote them would cause either memory leaks or cause the client code to try to access already disposed ...
2
votes
1answer
920 views

Search Optimization on SPListItemCollection

I have an SPListItemCollection (Thread Discussion Collection) that consists of almost 20,000 items. Each SPListItem (Thread Discussion) on the SPListItemCollection contains a sub SPListItem(Thread ...
1
vote
1answer
589 views

How do I select only top level folders using CrossListQueryCache?

I want to select the list of folders (without subfolders, not recursive) of a Document library using CrossListQueryCache. Everything is working fine except that i am receiving ALL the folders and ...
7
votes
2answers
3k views

Can I order by Content Type in a CAML query?

Is it possible to order by content type in a CAML query? I seem to always get the same result no matter what I do with the Order by. Ordering by ID instead works perfectly. query.Query = @" ...
1
vote
1answer
532 views

SPQuery.ViewFieldsOnly in WSS3?

In SharePoint 2010 SPQuery has the ViewFieldsOnly property that apparently optimises the query by only returning the data you specifically ask for. Unfortunately the 2007 version of SPQuery doesn't ...
3
votes
1answer
5k views

How do I query a list using CAML and SPQuery?

I have a SPList but I don't need to go through everything in that list. I need to establish a CAML query so I can limit the list items. Then, go thru each item from the query result and do something. ...
5
votes
2answers
955 views

Problem with CAML SPQuery ItemChildCount result

I know that this query works fine SPQuery query = new SPQuery(); query.Query = "<OrderBy><FieldRef Name='ItemChildCount' Ascending='FALSE' /></OrderBy>"; But my ...
1
vote
2answers
6k views

Create CAML SPQuery to order by ItemChildCount in descending order

How do I create a CAML query to display all items on the list order by ItemChildCount? Somewhat like this: Select * from table order by itemChildCount descending
5
votes
1answer
2k views

SPList.GetItems query returning an invalid SPListItemCollection. What am I doing wrong?

I'm trying to query an SPList object using a CAML query (see code below). SPQuery queryGetExistingTargetTask = new SPQuery(); queryGetExistingTargetTask.Query = ...
2
votes
1answer
309 views

Why do I sometimes have to use different SPQuery tags?

Every SPQuery's query should have <View><Query> query... </Query></View> tags? Sometimes I have to put without those tags to get it work and some times I have to put it ...
4
votes
1answer
6k views

CAML query with more than multiple AND/OR generates SPException “One or more field types are not installed properly. Go to the list settings page to delete these fields.”

I need to build a CAML query at runtime based on user input. The CAML query could be as simple as <Where> <Eq> <FieldRef Name="Status" /> <Value ...
2
votes
3answers
1k views

CAML Query Maximum Size

I am running a sharepoint caml query where I want to check that a field on an item is equal to one of many values. I do this dynamically and may wish to check against many hundreds of values. I found ...
3
votes
1answer
2k views

CAML 'Endswith' equivalent?

I have to pull the data from the custom list by using a CAML query. I would like to use the "Endswith" option in the CAML query however it seems to be unsupported in sharepoint 2007. What would be ...
3
votes
2answers
838 views

CAML OrderBy and managed metadata

I have something like this: SPQuery query = new SPQuery(); query.Query = "<OrderBy><FieldRef name=\"MyTerm\" /></OrderBy>"; myList.GetItems(query); I can sort on normal fields, ...
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
2answers
1k views

How to get the last x number of splistitems changed for a SPWeb

I'm trying to pull back the last x number of list items in all non-hidden lists for a given web. My original code would go through all lists and run the following code: SPQuery query = new ...
2
votes
2answers
1k views

Maximum lookup columns - the magic number 13

So I did create on an SPWeb 20 custom lists and then a tasks list. For each of those 20 lists I've created 20 site lookup columns. I then created 20 Content Types based on Task content type. Then I've ...