3
votes
2answers
181 views

Get SPWeb at all the levels

I have a root site with sites at different levels(depth is unknown). How can I find all the SPWeb objects iterating till the deepest level. will the below code give me desired result ...
0
votes
3answers
78 views

What is Site, Web, Site Template and Web Template in SharePoint?

Can anyone please tell me what the difference is between Site and Web in SharePoint. Also what is Site Template and Web Template?
0
votes
0answers
37 views

Displaying Sharepoint objects in PropertyGrid - low performance

At first i didn't know where I should ask this question since it's about Windows Forms and SharePoint but after a bit of searching I decided this is a good place. I would like to know if there's a ...
0
votes
0answers
95 views

Sites in SPContentDatabase returns null reference

I am trying to get the list of sites in a site collection. I have used SPContentDatabase to access the database of the site collection but some of the sites are returned as null although they are ...
1
vote
3answers
107 views

How to get all SPWebs using visual studio?

I want to get all webs including it's subwebs. Eg. Site web1 subweb1 subweb2 web2 How to achieve ?
0
votes
4answers
3k views

Detected use of SPRequest for previously closed SPWeb object after SPQuery

this code run yesterday very well and today I've been trying to solve this error for hour now : Please close SPWeb objects when you are done with all objects obtained from them, but not before I ...
0
votes
2answers
1k views

Get all SPLists for a site collection

I feel like I'm very close on this one. I know how to get the root site collection from this: How can I get the root site collection from SPContext.Current? I've been messing around with ...
0
votes
3answers
867 views

SPSite and SPWeb object dispose inside foreach loop

I have a code that loops through all the Sites and Webs in a web application. My code uses for..each loop to navigate through each site and web object. I was wondering if we are required to dispose ...
1
vote
2answers
2k views

Get file from any library in the web tree

Is it possible to use some built in SharePoint API to open a file no matter which web and library it's in? Example: Given the file: /subsiteA/PublishingImages/myimage.jpg I want to open it and get ...
3
votes
1answer
176 views

Disposing of SPWeb object query

I'm trying to understanding the object clean up process. using (SPSite siteCollection = new SPSite(siteUrl)) { SPWeb site = siteCollection.RootWeb; foreach (SPList list in site.Lists) { if ...
11
votes
3answers
2k views

Should I dispose these SPSite and SPWeb objects?

Is it necessary to dispose the site and web objects in the following code? If so, how do I do this? Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim site ...