SPQuery represents a query in a list view.

learn more… | top users | synonyms

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
390 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
2k 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
815 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
639 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
879 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
547 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
477 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
3k 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
909 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
5k 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
297 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
5k 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 ...
2
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
807 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 ...