I am currently using the following code to check if the spweb is there based on the name (sYear) if it is available then i am doing some login . I am sure that oSPSite.AllWebs will surely have performance issues if i have huge webs? Any better way to do this ? THanks in advance!!!
//Get the test center webcollection object oWebCollection = oSPSite.AllWebs("Sites/Test/TestCenter/").Webs()
// If Not oSPSite.AllWebs("Sites/Test/TestCenter/").Webs(sYear).Exists() Then
Try using SPSite OpenWeb Method instead. A comment on the linked msdn site also points out to make sure you dispose your web when you are done. -DK
Blog
It will get you a list of all the webs in a site (giving you access to the name, url and ID properties) and you can quickly pass that array to see if it exists - has much better performance (Im using it in a few of my solutions that have similar requirements)Brian Farnhill
Microsoft Certified Application Developer http://pointstoshare.spaces.live.com Canberra SharePoint User Group
Try using SPSite OpenWeb Method instead. A comment on the linked msdn site also points out to make sure you dispose your web when you are done. -DK
Blog