Created
November 3, 2012 18:28
-
-
Save vman/4008198 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPSiteDataQuery query = new SPSiteDataQuery(); | |
query.ViewFields = "<FieldRef Name=\"Title\" /><FieldRef Name=\"DueDate\" />"; | |
query.Query = @"<Where> | |
<And> | |
<Eq> | |
<FieldRef Name='AssignedTo'/> | |
<Value Type='User'>" + | |
SPContext.Current.Web.CurrentUser.Name | |
+ @"</Value> | |
</Eq> | |
<Neq> | |
<FieldRef Name='Status'/> | |
<Value Type='Choice'>Completed</Value> | |
</Neq> | |
</And> | |
</Where>"; | |
query.Lists = "<Lists ServerTemplate=\"107\" MaxListLimit=\"0\"/>"; //Tasks Lists | |
query.Webs = "<Webs Scope=\"Recursive\" />"; | |
//query.RowLimit = 100; | |
PortalSiteMapProvider ps = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode; | |
PortalWebSiteMapNode pNode = ps.FindSiteMapNode(curWeb.ServerRelativeUrl) as PortalWebSiteMapNode; | |
DataTable results = ps.GetCachedSiteDataQuery(pNode, query, SPContext.Current.Web); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment