28-09-12, 12:46 PM
Query Join between related lists in SharePoint 2010 using "SPQuery.Joins" property
One of the famous complains of the developers who switched from SQL background (For example Me :-)) to SharePoint development; is how to query related lists with joins instead on looping and filtering both of them using different queries.
You can Achieve this using the SPQuery.Joins Property.
Example:
Source: http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx
منقول منتدى فيجول بيسك
__________________
Emad Adel Hanna
Sharepoint Developer
it.emadadel@hotmail.com
http://emadadel.wordpress.com
http://www.sharepointegypt
http://www.facebook.com/groups/Sharepoint.Egypt
Member Of The Microsoft Egypt IT Pro Community
MCPD & MCP &MCT
One of the famous complains of the developers who switched from SQL background (For example Me :-)) to SharePoint development; is how to query related lists with joins instead on looping and filtering both of them using different queries.
You can Achieve this using the SPQuery.Joins Property.
Example:
Source: http://msdn.microsoft.com/en-us/libr...ice.14%29.aspx
منقول منتدى فيجول بيسك
__________________
Emad Adel Hanna
Sharepoint Developer
it.emadadel@hotmail.com
http://emadadel.wordpress.com
http://www.sharepointegypt
http://www.facebook.com/groups/Sharepoint.Egypt
Member Of The Microsoft Egypt IT Pro Community
MCPD & MCP &MCT