keyongtech


  keyongtech > sharepoint.* > sharepoint.development_and_programming > 01/2007

 #1  
01-08-07, 04:30 AM
David
Hi all,

I am working on a windows app to create a site and some other customisation.
I can create a subsite of an existing collection using the following code

' Define the toplevel site of the site collection
Dim topLevelSite As New SPSite(txtURL.Text.ToString)

' Set the toplevel site as the current site
Dim topLevelSiteWeb As SPWeb = topLevelSite.OpenWeb()
Dim subSites As SPWebCollection = topLevelSiteWeb.Webs()
'
Dim siteURL As String = txtNewSiteURL.Text.ToString()
Dim siteTitle As String = txtNewSiteTitle.Text.ToString()
Dim siteDesc As String = txtNewSiteDesc.Text.ToString()
' Create subsite
subSites.Add(siteURL, siteTitle, siteDesc, Convert.ToUInt32(1033),
"STS#0", False, False)

But I am having trouble creating a new site collection. Does anyone have any
pointers? I am trying to create a new collection using the site path
http://spsportal/sites

Cheers

David
 #2  
01-09-07, 03:41 AM
Ishai
site collections are not "SPWeb" objects. they are "SPSite" objects, and you
create them from the SPWebApplication object.

Ishai Sagi
read my sharepoint developer tips - www.spstips.blogspot.com

"David" wrote:
[..]
Similar Threads
Deleting Site deffinition from Create Site Collection page in MOSS

I tried to create a new site deffinition using VS2008. It went wrong. If I now goto Central Administration/Application Management/Create site collection, an entry...

Changing Project Server to create a new site collection for each project site

When my tech support person installed Project Server, I'm pretty sure it creates a sub-site under the default. 1. How can determine that for sure? 2. How can I change the...

create a new site collection with a saved site template

ok lets say I create a site and customize how I like, I save the site as a template. Now what I want to do is from central administration create a new site collection that...

Differences between Site Collection Owner and Site Collection Admi

The blurbs in the KB make them seem very similar - can someone outline the differences and when you would use one vs the other? Thanks, Brad

How to Programatically create subsites under my Toplevel site

Hi All, I am getting the error "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again" when i try...


All times are GMT. The time now is 12:45 PM. | Privacy Policy