Find Duplicate Documents in SharePoint 2010 using SPSiteDataQuery


SPSiteDataQuery query = new SPSiteDataQuery();                    
                        query.Webs = "<Webs Scope='SiteCollection' />"; //query all web sites in site collection
                        query.Lists = "<Lists ServerTemplate='101' Hidden='FALSE' MaxListsLimit='0' />";
                        query.Query = string.Empty;
                        query.Query = "<Where><Eq><FieldRef Name='FileLeafRef' /><Value Type='File'>" +    lblDocumentName.Text + "</Value></Eq></Where>";
                        query.ViewFields = _viewFields;
                        results = oweb.GetSiteData(query);                                                               
                        GrdDuplicates.DataSource = results;
                        GrdDuplicates.DataBind();
                     

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