CrossListQueryInfo in SharePoint

                  
The CrossListQueryInfo object uses the CrossListQueryInfo object to get the cached results or, if there are no cached results available, it performs a cross-list query to the database and then caches the results for future use.


      CrossListQueryInfo clqi = new CrossListQueryInfo();
                        clqi.Query = "<OrderBy><FieldRef Ascending=\"FALSE\" Name=\"Title\" /></OrderBy><Where><BeginsWith><FieldRef Name=\"Title\" /><Value Type=\"Text\">Test</Value></BeginsWith></Where>";
                        clqi.ViewFields = "<FieldRef Name=\"Title\" /><FieldRef Name=\"ContentType\" />";
                        clqi.Lists = "<Lists BaseType=\"1\" />";
                        clqi.Webs = "<Webs Scope=\"SiteCollection\" />";
                        clqi.UseCache = true;

                        CrossListQueryCache clqc = new CrossListQueryCache(clqi);
                        DataTable tbl = clqc.GetSiteData(osite, CrossListQueryCache.ContextUrl());
                        GridView1.DataSource = tbl;

                        GridView1.DataBind();


Note :

CrossListQueryCache Routine

Uses Cache
GetSiteData (SPSite)
Yes
GetSiteData (SPWeb)
No
GetSiteData (SPSite, String)
Yes
GetSiteData (SPWeb, SPSiteDataQuery)
No

hope this will helps you...

Happy Coding...

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell