SPQuery represents a query in a list view.

learn more… | top users | synonyms

0
votes
1answer
760 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
2answers
234 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
0answers
26 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 ...
1
vote
4answers
3k 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> ...
0
votes
0answers
19 views

Expand SharePoint Calendar Recurring Event in SSIS Project using CAML

Is it possible to expand recurring SharePoint calendar events using a CAML query in a SharePoint List Source using the SharePoint adapter off of Codeplex? I have been searching all day and found many ...
1
vote
1answer
39 views

Best way of retrieving a collection of SPSite in code

I have a page where the user will be entering a data in a textbox, and click submit, and it brings all site collections that url contains this data in textbox, I am currenlty doing a Linq query to ...
2
votes
2answers
123 views

SPQuery - Which fields (ViewFields) are required to Update the list item?

In an SPQuery, which fields are required to update a list item? SPQuery query = new SPQuery(); query.Query = @" <OrderBy> <FieldRef Name='ID' Ascending='true' /> ...
2
votes
2answers
125 views

Sharepoint field not found exception

I am querying a SPList in sharepoint 2010 and populating the corresponding grid view: <asp:DataGrid runat="server" ID="gridView" AutoGenerateColumns="false" ...
0
votes
1answer
4k 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
137 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); ...
2
votes
1answer
676 views

CAML query limitation of values in IN operator

I have less than 5000 items in my library. I want to get 530 items by ids. So I am using following query. <Where> <In> <FieldRef Name="ID" /> <Values> ...
1
vote
1answer
52 views

Is there any benefit of using multiple lists to store documents versus a single library in large lists?

Background: We are migrating a legacy system into Sharepoint and will look to migrate around 300 000 documents. There is some metadata which inherently diferentiates the documents from eachother. ...
1
vote
2answers
1k views

Using SPQuery with SPList.GetItems(SPView)

I have a web-part which displays a variety of items in a spgridview based on a SPView. Additionally, I have implemented a search module which when a keyword is entered should get all items that has a ...
0
votes
1answer
132 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 ...
2
votes
1answer
524 views

SharePoint 2013 list items paging

I'm trying to make a webpart with list items paging. I followed this link http://www.directsharepoint.com/2011/03/step-by-step-guide-to-implement-paging.html and on SharePoint 2010 server it works ...
0
votes
1answer
80 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
1answer
30 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 ...
2
votes
2answers
1k views

SPQuery works on libraries under the list view threshold, but not over

So I am building a webpart which enumerates all doclibs in the current web, grabbing all checked out files and listing them in a table, allowing a user to apply some required metadata and check in ...
3
votes
2answers
656 views

Get SPQuery TotalItems from query

I want to get the total number of items that match my Query, BUT also limit the results. So say I have 100 items in the list. 50 of the 100 items in the list match my query. I want to only get 10 ...
1
vote
1answer
522 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 ...
1
vote
1answer
305 views

SPQuery on null lookupfield

I have a contact list with a company lookup field and I need to retrieve those without any company associated so I was thinking can I put it like this: <Query> <OrderBy> ...
2
votes
1answer
622 views

Caml Query - skip X first results

Let's assume I have list with 100 items. Is it possible to write CAML query to get 5 items, but skip 10 items from the beggining? Something like LIMIT and OFFSET in SQL?
0
votes
4answers
3k 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 ...
1
vote
0answers
168 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
1k views

How to Set SPQuery.RowLimit to get all items?

I'm using my SPList View to get the html code of extracted items by an SPQuery over the listview SPList myList = mySite.RootWeb.Lists.GetByInternalName("ListINStr"); SPView oView = ...
5
votes
2answers
316 views

SPQuery returning different before and after using RunWithElevatedPrivileges method

I am having a huge problem here. I am executing a query looking for a SPListItem, when I execute this query with user identity it works well, retuning the fields "Author" and "Editor" that I need. ...
1
vote
2answers
405 views

SPQuery always returns values

I am trying to check a list for related values but for some reason every item in the list is returned each time. I have seen this issue before and for me its always meant a bad CAML string but I have ...
0
votes
2answers
127 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 ...
2
votes
0answers
46 views

Mysterious DBCS (Double-Byte-Characters), i.e Kanji from SiteData query

Records returned from SPWeb.GetSiteData have some fields encoded in DBCS (Kanji characters). What could be causing this?
5
votes
1answer
1k 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 = ...
1
vote
2answers
1k views

GetDataTable from SPListItemCollection

My question is regarding the use of DataTable vs ListItemCollection. Basically I have a small solution, where I have to loop through the items in the list to verify if the items already exists or not. ...
3
votes
1answer
185 views

Fetching from large lists while throttling is enabled

Here's the situation: I have a heavily customized web application built on top of MOSS 2007 We're in the process of upgrading the application to SharePoint 2010 QA has identified that a page which ...
1
vote
1answer
186 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 ...
0
votes
1answer
592 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
0answers
92 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 ...
1
vote
2answers
602 views

Simple SPQuery throws error

I am trying to pull populate a lookup field using a lookup value without the lookup ID. I am getting the error: "One or more field types are not installed properly. Go to the list settings page to ...
0
votes
3answers
716 views

What is the difference between CamlQuery and SPQuery

Maybe a simple question, when to use CamlQuery and when to use SPQuery ? I think that SPQuery is used inside a WebPart running on the SharePoint server, and that CamlQuery is part of the Client ...
0
votes
2answers
239 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 ...
3
votes
2answers
1k views

Use SPQuery.RowLimit also on large lists with small query results?

I frequently read one should use RowLimit on SPQuerys on a large list, especially with more than 2000 items. Best Practices: Common Coding Issues When Using the SharePoint Object Model: An ...
2
votes
2answers
209 views

QueryThrottleMode in non-query operations?

I have a big List which I want to empty. Therefore I create a template from that list, delete the list and create a new list from the template I just saved before. I know there are other ...
1
vote
1answer
2k views

Adding IsNotNull and ViewFields in CAML Query

Trying to add IsNotNull parameter and ViewFields paramter but throwing an error. Am I inserting incorrectly or missing something to make sure this executes correctly? Seems like View is bring back all ...
0
votes
1answer
2k 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 ...
1
vote
2answers
2k views

date ranges in CAML queries

I have a list with a datetime filed. I want selected items from this with date rang. I use this code <Where> <And> <Geq> <FieldRef Name='SendDate' /> <Value ...
1
vote
0answers
161 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
1answer
764 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
213 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
2k 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 ...
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 ...
1
vote
1answer
265 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
108 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 ...