New answers tagged

1

If you write: using (SPSite siteCollectionParent = new SPSite(strUrl)) you don't need to dispose because the using-Method will do this for you as you guessed. But this has no impact on your child-Instances! So for disposing your siteCollectionChild you can write foreach(SPSite siteCollectionChild in childCollections) { try { ...


0

If you dispose SPSite siteCollectionParent it will dispose only site collection with url strUrl. ie. only 1 site collection And disposing childCollections or every single siteCollectionChild is similar. just you are disposing in a go if you dispose childCollections. NOTE: You are disposinig every single SPSite in the web application. Be careful about ...



Top 50 recent answers are included