.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Cross list query for two sharepoint lists and a join between the fields

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :SharePoint
Hello All, I have a requirement where i need to query the data from two  sharepoint lists  on a same site by doing a join between those lists and get the result into datatable.I am doing this using sharepoint object model.Is there any possibility to do this. Any pointers in the right direction are greatly appreciated. Thank you Smith   smith

View Complete Post

More Related Resource Links

How to join two sharepoint list in c# by CAML query?

Hii All,
   I am using wss 3.0 and i have one site and site has 4 to 5 lists. lists are interconnected with lookup column and same column. I need to display some column fron one list and some from another.. i need to join that lists by where condition like project =project..

So how can i join??

Thank You

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Video: SharePoint 2010 Lists, List Data, and CAML

This demonstration illustrates how to work with list data and the Collaborative Application Markup Language (CAML). (Length: 5:05)

Importing SharePoint List Data into Project Server 2007 Custom Fields

Learn how to use the programmability features of Project Server 2007 and Windows SharePoint Services 3.0 to import SharePoint list data into an enterprise custom field.

How to query for id's of the fields with List Data Retrival Services Query() web service

Since i marked a post as answer in my previous topic, it seems that people dont visit the topic anymore as they see it as "answered" while it actually is only partially answered. So i guess i have to ask again in a different topic.    I need to get data from Sharepoint Server (3.0 i belive) for my Integration Services project. For that i use Sharepoint's webservices. I've read tutorials and downloaded sample programs to talk to WSS web services. I realise i have two ways to get items in a list: Use Query() or GetListItems(). Problem is, GetListItems() has a mandatory "Row limit" field and i might have to import ALOT of fields, so i thought Query() is better for me.  But, when using GetListItems(), the WSS returns the ID of the fields (for example, for a field of type user, something like "395;Ivanov Ivan Ivanovich" is returned) but when using Query() for the same list, WSS returns only the field value ("Ivanov Ivan Ivanovich") without the ID. I need it to return the ID as well. How can i set it up, on my side or server side, so i would receive the ID's, not only the values of the fields that are actually linking to something by ID when i use Query() web service?     

how to Join two SharePoint Lists in SharePoint 2010

I have one Document Library and One List, just want display data from both based on ID in SharePoint 2010. Document Library : "Doc1" having following columns 1. ID (default column) 2. Title 3. Description 4. Image Url List : "List1" having following columns 1. RefID ( lookup column, refers the doc1 ID column) 2. Created By I want to display get data table for what are the ID's(items) created by me using CAML Query (SPQuery.Joins)  

Join two Lists/Library in SharePoint 2010

I have one Document Library and One List, just want display data from both based on ID in SharePoint 2010. Document Library : "Doc1" having following columns 1. ID (default column) 2. Title 3. Description 4. Image Url List : "List1" having following columns 1. RefID ( lookup column, refers the doc1 ID column) 2. Created By I want to display get data table for what are the ID's(items) created by me using CAML Query (SPQuery.Joins) Pls give me solution... Thanks in adv...

Duplicate URLs in Source Parameter of Query String for All SharePoint Lists

After performing a database attach method of upgrading our existing web application from MOSS 2007 to SharePoint Server 2010, all of our lists that migrated now exhibit an interesting but undesirable behavior.  The DispForm.aspx and EditForm.aspx pages that get loaded are given the Source parameter of the query string but instead of the URL being a single entry like: Source=http://sharepointsite.domain.com/Pages/Default.aspx It winds up putting the URL twice like this: Source=http://sharepointsite.domain.com/Pages/Default.aspx,http://sharepointsite.domain.com/Pages/Default.aspx Naturally this makes processing of the form -- either by choosing OK or Cancel buttons -- result in an HTTP 404 error.  The question we're left with is how in the world did the Source parameter get set that way to begin with.   It wasn't that way in 2007. We had thought that perhaps there was something that didn't migrate over correctly for the existing lists, so I tried creating a new list and then added a new item to the list.  So far so good.  Then attempted to Edit Properties or Edit Item or even View Item, etc. -- essentially triggering the load of the EditForm.aspx and DispForm.aspx  -- and we received the 404 again.  At this point we're not sure what's going on or how to fix it.  We've performed the migration three times so far with t

Versioning lists in Sharepoint (not list items)

I need to keep a track of what all changes have been made to a custom list since it was first created. I need to have track of what columns were added/removed and when. I know that we have versioning for list items so as to keep track of what all changes have been made to an item but what I am looking for is versioning of the list itself rather than the list items. Is this possible?

Query Sharepoint list, rich text columns returning HTML tags

Hi! So I have an issue that maybe someone of you have encountered as well. I am querying a Sharepoint list and creating a report from the data collected from this list. This all works fine except that one of the columns in this list is of the type "Multiple lines of text" and also supports "rich text" with different fonts, sizes and so on. This has the effect that the text returned from this column is wrapped in HTML tags that specifies how the text should be formatted. Naturally I do not want this HTML code to appear in my report so for now I have used custom code to do a string.replace and replaced for example <div></div> and <br> with "". However, this column also has url references to documents and these links shows up like this "/servername/site/subsite/Gemensamma%20dokument/Mwh.docx">http://servername/site/subsite/Gemensamma%20dokument/Mwh.docx There is some sort of double reference to the document that I guess like the HTML tags are embedded in the answer from the rich text column and this is not so easy to do a string replace on because the url varies with the different document and document names. My question really is if anyone of you have done a similar report that I am doing, and have encountered this fenomen with this sharepoint column and how you did to solve this? I have tried to creat

How to submit my form to Sharepoint Library as well as Sharepoint List with specific Fields only.

Hello ,   I have a Infopath form that contain 50 of fields. i want to submit those form into sharepoint library as well as Sharepoint Custom List(Specific Fields). Please suggest best practice to develop such a functionality.   Thank you.

Setting SharePoint 2010 Form Fields Using Query String Variables


Hi All,

I have a requirement to populate sharepoint form field value with query string while uploading document to document library.

While uploading the document to document library, I want to populate claim number available from query string in a pop up page i.e in my case EditForm.aspx, Located at http://servername:port/sitename/documentlibraryname/forms/EditForm.aspx.

Additional Information:

  • Created document library and added custom columns like claim number etc..
  • Created a view to filter uploaded documents as per claim number.

Server Details:

  • Windows Server 2008 R2
  • SharePoint 2010
  • SQL Server 2008 R2

I have written javascript for the same, but not sure where exactly to add the code in EditForm.aspx page.

Any help on this would be greatly appreciated.

Thanking you in advacne.



SharePoint List Query Filter


I am writting an SSRS report where I am querying a SharePoint list and trying to filter the data through the CAML query.  In BIDS, the query returns data, but the filter where clause doesn't seem to be getting recognized as I get all of the data back.  The where clause does seems to work in the U2U CAML Query Builder tool.

Can anyone please give advice as to why my where clause isn't working?


   <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems">
         <Parameter Name="listName">
                   <DefaultValue>Subscribe - Sales by Product Group - Wheel</DefaultValue>

How can I split one Sharepoint 2010 List into two Sharepoint 2010 Lists which are displayed side-by-


I have a list (table) with 50 items which is in a webpart zone of a Sharepoint 2010 page. Unfortunately, users have to scroll down the page to see the last items in the list. Therefore I would like to break the list in two and display both lists (each with 25 items) side by side in the same webpart zone. How can I do this? 

The only thing I can think of is to add a new webpart zone next to the other one, put a copy of my 50 items list in it, and apply filters to the lists so that the left one displays items 1-25 and the right one displays items 26-50. Unfortunately, I will have to change my filters once in a while.

SSIS SharePoint List Adapter - how to query Users & Groups?


I am using SSIS SharePoint List Adapter to load data in and out of my SharePoint Lists from within SSIS, and most of it is working fine.  However, I need to perform a lookup against the Users & Groups collection in SharePoint so I can retrieve the UserID and set the value when writing back to SharePoint.  Any help would be tremendously appreciated!


"One of the fields on the SharePoint List does not exist or has become corrupt." in crawl log


Hi all,

I get this error message frequently in the crawl logs, but only for the publishingimages library. If I access the url e.g. http://site/subsite/publishingimages/forms an error is displayed that I should check the settings page of the list for corrupt fields - but there is nothing displayed there. If I access the list itself via http://site/subsite/publishingimages, I can access the list without problems.

In other publishingimages libraries, the error does not occur and I am simply redirected to the allitems.aspx.

Does anybody know this problem or has any hint where I should search?

I compared a working library with a not working one in sharepoint designer, but I could find no difference.



Cross list using sharePoint 2010



Just want to ask how could I create a custom code for the cross-site lookup using sharepoint 2010, my Objective are the following:

·     In SiteA List1 and SiteB List2 I need to associate a column for my lookup?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend